/* The reviews that roll: big serif words on a black page, a quote mark in the colour of the guest speaking, the
   guests' tiles and their time bars under it. */
:root {
  --page: #000000;          /* the page */
  --ink: #f4efe6;
  --muted: #8f8a82;
  --track: #2a2926;
  --tone: #f2a98a;          /* the colour of the guest speaking: set by the script */
}

* {
  box-sizing: border-box;
}

html {
  touch-action: manipulation;
}

html,
body {
  margin: 0;
}

body {
  min-height: 100svh;
  background: var(--page);
  color: var(--ink);
  font-family: 'Karla Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.stage {
  min-height: 100svh;
  display: grid;
  place-items: center;
  padding: 40px 20px;
}

.reviews {
  position: relative;
  width: min(720px, 100%);
}

/* as wide as the mark itself, so it pops round its own corner */
.reviews__mark {
  display: block;
  width: fit-content;
  height: 64px;
  margin-bottom: 6px;
  font-family: 'Playfair Display Variable', Georgia, serif;
  font-size: 128px;
  font-weight: 700;
  line-height: 1;
  color: var(--tone);
  transform-origin: 30% 70%;
}

/* the slides lie on top of each other: the one leaving and the one coming cross in the same place */
.reviews__slides {
  display: grid;
  touch-action: pan-y;
}

.slide {
  grid-area: 1 / 1;
  margin: 0;
}

.slide__quote {
  margin: 0;
}

.slide__words {
  margin: 0;
  font-family: 'Playfair Display Variable', Georgia, serif;
  font-size: clamp(22px, 3.6vw, 32px);
  font-weight: 450;
  line-height: 1.32;
  letter-spacing: -0.005em;
  text-wrap: pretty;
}

.slide__who {
  display: block;
  margin-top: 26px;
}

.slide__name,
.slide__when {
  display: block;
}

.slide__name {
  font-size: 17px;
  font-weight: 700;
}

.slide__when {
  margin-top: 3px;
  font-size: 15px;
  color: var(--muted);
}

/* ---------------------------------------------------------------- the guests and the buttons */
.reviews__foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin-top: 34px;
}

.reviews__people {
  display: flex;
  gap: 12px;
}

.person {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.person__tile {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 15px;
  font-size: 16px;
  font-weight: 700;
  color: #17140f;
  opacity: 0.42;
  transition: opacity 0.35s;
}

.person[aria-current='true'] .person__tile {
  opacity: 1;
}

@media (hover: hover) {
  .person:hover .person__tile {
    opacity: 0.8;
  }

  .person[aria-current='true']:hover .person__tile {
    opacity: 1;
  }
}

.person:focus-visible {
  outline: none;
}

.person:focus-visible .person__tile {
  outline: 2px solid var(--ink);
  outline-offset: 3px;
}

/* the time bar: full for the reviews already read, filling for the one showing, empty for the ones to come */
.person__time {
  position: relative;
  width: 46px;
  height: 3px;
  overflow: hidden;
  border-radius: 2px;
  background: var(--track);
}

.person__fill {
  position: absolute;
  inset: 0;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: 0 50%;
}

.reviews__controls {
  display: flex;
  gap: 6px;
}

.ctl {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  box-shadow: inset 0 0 0 1.5px var(--track);
  cursor: pointer;
  transition: box-shadow 0.25s, background-color 0.25s;
  -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
  .ctl:hover {
    background: rgba(244, 239, 230, 0.08);
  }
}

.ctl:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.ctl svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ctl__play {
  display: none;
  fill: currentColor;
  stroke-width: 1.6;
}

.ctl.is-paused .ctl__pause {
  display: none;
}

.ctl.is-paused .ctl__play {
  display: inline;
}

@media (max-width: 560px) {
  .reviews__mark {
    height: 52px;
    font-size: 104px;
  }

  .reviews__foot {
    flex-direction: column;
    align-items: flex-start;
  }

  .reviews__people {
    gap: 10px;
  }

  .person__tile,
  .person__time {
    width: 42px;
  }

  .person__tile {
    height: 42px;
    border-radius: 14px;
  }
}
