/* The prism billboard: a row of three-sided prisms on warm paper, one word on each side. The script sets the size of
   the board (--bw, --bh) and of one prism (--cw, --ap). */
:root {
  --paper: #f3f0e8;    /* the page */
  --face: #faf8f3;     /* the sides of the prisms */
  --ink: #141414;      /* the words and the hairlines */
  --accent: #e8431f;   /* the third word */
  --soft: #8d887e;     /* the small lines of type */
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: 'Anybody Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.stage {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.poster {
  display: grid;
  gap: 14px;
  width: var(--bw, 80vw);
}

.caption {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin: 0;
  font-size: 11px;
  font-weight: 500;
  font-variation-settings: 'wdth' 118;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
  color: var(--ink);
  opacity: 0;
}

.caption--under {
  color: var(--soft);
}

/* the board: a hairline frame around the prisms, with the perspective on it */
.board {
  position: relative;
  width: var(--bw, 80vw);
  height: var(--bh, 24vw);
  outline: 1px solid var(--ink);
  outline-offset: 6px;
  perspective: calc(var(--bw, 80vw) * 1.6);
}

.prism {
  position: absolute;
  top: 0;
  width: var(--cw, 50px);
  height: 100%;
  transform-style: preserve-3d;
}

/* each side is the width of the prism, pushed out from its axis; it shows its own slice of the word */
.side {
  position: absolute;
  inset: 0 -1px 0 0;   /* a pixel wider than the prism, so no thin gap opens between two slices */
  overflow: hidden;
  background: var(--face);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  box-shadow: inset 1px 0 0 rgba(20, 20, 20, 0.08);
}

.side__word {
  position: absolute;
  top: 0;
  width: var(--bw, 80vw);
  height: 100%;
  display: grid;
  place-items: center;
  line-height: 1;
  white-space: nowrap;
  text-transform: uppercase;
}

.side--accent .side__word {
  color: var(--accent);
}

/* the shade of a side turned away from you; the script sets its opacity */
.side__shade {
  position: absolute;
  inset: 0;
  background: var(--ink);
  opacity: 0;
  pointer-events: none;
}

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  margin: 0;
}
