/* The thumb riffle transition: the page lifts off the table and shows it is the top sheet of a pad, the thin sheets
   just fanned at the edge. A thumb riffles the pad sideways, every sheet a frame of a flip book, and the pad stops on
   the next page with a small knock, where the ribbon marker hangs out. */
:root {
  --paper: #f3f0e8;
  --ink: #141414;
  --table: #e3dfd5;
  --accent: #e0452a;
  --edge-light: rgba(20, 20, 20, 0.2);
  --edge-dark: rgba(243, 240, 232, 0.16);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--table);
  font-family: 'Fraunces Variable', Georgia, serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

.stage {
  /* the script writes --hs and --ts (the sizes of the two big words) */
  --pad: clamp(20px, 4.2vw, 64px);
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: var(--table);
}

/* ------------------------------------------------------------------ the pad */
.deck,
.pan {
  position: absolute;
  inset: 0;
}

.deck {
  transform-origin: 50% 50%;
}

.sheet {
  /* every sheet has its own paper tone and ink (the script writes them on the sheets in between) */
  --bg: var(--paper);
  --fg: var(--ink);
  --edge: var(--edge-light);
  position: absolute;
  inset: 0;
  background: var(--bg);
  color: var(--fg);
  box-shadow: 0 0 0 1px var(--edge);
  transform-origin: 0 50%;
  will-change: transform;
}

.page--b {
  --bg: var(--ink);
  --fg: var(--paper);
  --edge: var(--edge-dark);
}

.sheet--under {
  --bg: #1d1c1a;
  --edge: var(--edge-dark);
}

.sheet--last {
  box-shadow: 0 0 0 1px var(--edge), 0 34px 60px -26px rgba(20, 20, 20, 0.45);
}

.sheet__shade {
  position: absolute;
  inset: 0;
  z-index: 5;
  background: linear-gradient(90deg, rgba(20, 20, 20, 0.04), rgba(20, 20, 20, 0.42));
  opacity: 0;
  pointer-events: none;
}

/* ------------------------------------------------------------------ the page */
.bar,
.foot {
  position: absolute;
  left: var(--pad);
  right: var(--pad);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
}

.bar {
  top: calc(var(--pad) * 0.8);
}

.foot {
  bottom: calc(var(--pad) * 0.8);
  font-size: 13px;
  letter-spacing: 0.01em;
}

.foot span {
  opacity: 0.55;
}

.brand {
  font-size: 19px;
  font-weight: 620;
  font-variation-settings: 'SOFT' 100, 'WONK' 1;
  letter-spacing: -0.01em;
}

.nav {
  display: flex;
  gap: clamp(16px, 2.4vw, 32px);
  font-size: 14px;
}

.nav a,
.nav span {
  color: inherit;
  text-decoration: none;
  opacity: 0.55;
  transition: opacity 0.25s ease, color 0.25s ease;
}

.nav [aria-current] {
  opacity: 1;
}

@media (hover: hover) {
  .nav a:not([aria-current]):hover {
    opacity: 1;
    color: var(--accent);
  }
}

a:focus-visible {
  outline: 1px solid var(--accent);
  outline-offset: 6px;
  border-radius: 2px;
}

.hero {
  position: absolute;
  left: var(--pad);
  right: var(--pad);
  top: 54%;
  height: 0;
}

/* the big word stands on the hero line; its letters slide in a mask, so they can sink below the line and rise from it */
.big {
  position: absolute;
  left: 0;
  bottom: 0;
  margin: 0;
  font-size: var(--hs, 140px);
  line-height: 1;
  font-weight: 320;
  font-variation-settings: 'SOFT' 50, 'WONK' 0;
  letter-spacing: -0.035em;
  white-space: pre;
  width: max-content;
}

.big--b {
  font-size: var(--ts, 140px);
  font-weight: 600;
  letter-spacing: -0.03em;
}

.big__mask {
  display: block;
  overflow: hidden;
  padding: 0.16em 0.1em 0.27em;
  margin: -0.16em -0.1em -0.27em;
}

.ch {
  display: inline-block;
}

.kicker {
  position: absolute;
  left: 0;
  bottom: calc(var(--hs, 140px) * 1.12);
  margin: 0;
  font-size: 13px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-family: system-ui, sans-serif;
  opacity: 0.6;
}

.go {
  position: absolute;
  left: 0;
  top: calc(var(--hs, 140px) * 0.34 + 10px);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
  font-size: 16px;
  font-weight: 480;
}

.below {
  position: absolute;
  left: 0;
  top: calc(var(--ts, 140px) * 0.3 + 8px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(20px, 3vh, 28px);
}

.below .go {
  position: relative;
  top: auto;
}

.lede {
  margin: 0;
  max-width: 34ch;
  font-size: clamp(15px, 1.25vw, 18px);
  line-height: 1.5;
  opacity: 0.62;
}

.go__text {
  display: inline-block;
}

/* the arrow: its shaft stretches under the pointer */
.go__arrow {
  position: relative;
  display: inline-block;
  width: 30px;
  height: 12px;
}

.go__shaft {
  position: absolute;
  top: 50%;
  height: 1.5px;
  width: 17px;
  margin-top: -0.75px;
  background: currentColor;
}

.go__head {
  position: absolute;
  top: 0;
  width: 8px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.go:not(.go--back) .go__shaft {
  left: 0;
  transform-origin: 0 50%;
}

.go:not(.go--back) .go__head {
  left: 10px;
}

.go--back .go__shaft {
  right: 0;
  transform-origin: 100% 50%;
}

.go--back .go__head {
  right: 10px;
}

.go__text .lt {
  display: inline-block;
  white-space: pre;
}

/* ------------------------------------------------------------------ the ribbon marker */
.ribbon {
  position: absolute;
  left: 74%;
  top: 100%;
  width: 7px;
  height: clamp(30px, 6.5vh, 62px);
  background: var(--accent);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 80%, 0 100%);
  transform-origin: 50% 0;
}

@media (max-width: 600px) {
  .brand {
    font-size: 17px;
  }

  .foot {
    font-size: 12px;
  }

  .go {
    font-size: 15px;
  }

  .ribbon {
    width: 6px;
  }
}
