/* Pictures between the words: one sentence in the middle of the screen, with small pictures that follow their
   words. A picture is a window: its width opens and closes, the picture inside keeps its size. */
:root {
  --clay: #f4ece0;          /* the page */
  --ink: #2b211c;           /* text */
  --radius: 0.16em;         /* the windows' corners, in letter heights */
  --edge: clamp(18px, 3.4vw, 52px);
}

* {
  box-sizing: border-box;
}

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

body {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  min-height: 100svh;
  background: var(--clay);
  color: var(--ink);
  font-family: 'DM Sans Variable', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
}

.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px var(--edge);
  font-size: 15px;
}

.brand {
  font-family: 'Fraunces Variable', Georgia, serif;
  font-size: 22px;
  font-weight: 600;
  font-variation-settings: 'SOFT' 100;
}

.bar__nav {
  display: flex;
  gap: clamp(16px, 2.4vw, 36px);
}

.bar__nav a {
  transition: opacity 0.2s;
}

@media (hover: hover) {
  .bar__nav a:hover {
    opacity: 0.55;
  }
}

/* ---------------------------------------------------------------- the sentence */
.stage {
  display: grid;
  place-content: center;
  justify-items: center;
  gap: clamp(22px, 3vw, 40px);
  padding: 0 var(--edge);
}

.sentence {
  max-width: 17em;
  margin: 0;
  font-family: 'Fraunces Variable', Georgia, serif;
  font-size: clamp(32px, 5.4vw, 88px);
  font-weight: 480;
  font-variation-settings: 'SOFT' 100, 'opsz' 96;
  line-height: 1.1;
  letter-spacing: -0.02em;
  text-align: center;
}

/* a word and its picture never part at the end of a line */
.pair {
  white-space: nowrap;
}

/* the window: its width and its left margin open and close together (script.js); the picture stays centred */
.win {
  position: relative;
  display: inline-block;
  width: 1.38em;
  height: 0.8em;
  margin-left: 0.18em;
  vertical-align: -0.06em;
  border-radius: var(--radius);
  overflow: hidden;
  /* Safari clips a rounded box with a transformed child only with its own layer */
  transform: translateZ(0);
}

.win__pic {
  position: absolute;
  top: 0;
  left: 50%;
  width: 1.38em;
  height: 100%;
  margin-left: -0.69em;
  transform-origin: 50% 50%;
}

.note {
  max-width: 44ch;
  margin: 0;
  text-wrap: balance;
  font-size: clamp(15px, 1.2vw, 18px);
  line-height: 1.45;
  text-align: center;
  opacity: 0.7;
}

/* ---------------------------------------------------------------- pause */
.foot {
  display: flex;
  justify-content: center;
  padding: 0 var(--edge) 24px;
}

.foot__pause {
  padding: 10px 16px;
  border: 1px solid rgba(43, 33, 28, 0.25);
  border-radius: 999px;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.2s;
}

@media (hover: hover) {
  .foot__pause:hover {
    background: rgba(43, 33, 28, 0.06);
  }
}

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

@media (max-width: 760px) {
  .bar__nav {
    gap: 14px;
    font-size: 14px;
  }

  .sentence {
    font-size: clamp(28px, 8.4vw, 40px);
    line-height: 1.16;
  }
}
