/* Page coordinates (CSS px): no container. Content 32..508; five numeral cells of 95.2px between two ink rules. */
@property --pg-l {
  syntax: "<length>";
  inherits: false;
  initial-value: 0px;
}

@property --pg-r {
  syntax: "<length>";
  inherits: false;
  initial-value: 0px;
}

.pg {
  --paper: #efe9dc;
  --ink: #141210;
  --red: #e5231b;
  width: 540px;
  height: 540px;
  box-sizing: border-box;
  display: grid;
  place-items: center;
  background: var(--paper);
  color: var(--ink);
  font-family: "Bodoni Moda Variable", serif;
  font-optical-sizing: auto;
}

.pg * { box-sizing: border-box; }

.pg-block { width: 476px; }

.pg-status {
  margin: 0;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--ink);
  font-size: 25px;
  font-weight: 500;
  line-height: 32px;
  font-variant-numeric: lining-nums;
}

.pg-nav {
  position: relative;
  display: block;
}

.pg-list {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  margin: 0;
  padding: 0;
  list-style: none;
}

.pg-item { display: block; }

.pg-link,
.pg-mark > span {
  display: block;
  width: 100%;
  height: 168px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 132px;
  font-weight: 500;
  line-height: 172px;
  text-align: center;
  font-variant-numeric: lining-nums;
  font-variation-settings: "opsz" 18;
  cursor: pointer;
  outline: none;
}

.pg-link:focus-visible { box-shadow: inset 0 -6px 0 var(--ink); }

/* The slab covers the whole row and is clipped to the current cell, so the knocked-out numerals never move. */
.pg-mark {
  --pg-l: calc((var(--p) - 1) * 95.2px);
  --pg-r: calc((5 - var(--p)) * 95.2px);
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  width: 100%;
  height: 168px;
  background: var(--red);
  color: var(--paper);
  clip-path: inset(0 var(--pg-r) 0 var(--pg-l));
  pointer-events: none;
  /* leading edge goes first, trailing edge follows */
  transition:
    --pg-r 300ms cubic-bezier(0.3, 0, 0.1, 1),
    --pg-l 360ms cubic-bezier(0.5, 0, 0.2, 1) 110ms;
}

.pg-mark[data-back] {
  transition:
    --pg-l 300ms cubic-bezier(0.3, 0, 0.1, 1),
    --pg-r 360ms cubic-bezier(0.5, 0, 0.2, 1) 110ms;
}

.pg-step-item {
  display: flex;
  grid-column: span 2;
  padding-top: 14px;
  border-top: 2px solid var(--ink);
}

.pg-step-item:last-child {
  grid-column: 3 / span 3;
  justify-content: flex-end;
}

.pg-step {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 40px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-size: 27px;
  font-style: italic;
  font-weight: 500;
  line-height: 40px;
  cursor: pointer;
  outline: none;
  transition: translate 80ms ease-out;
}

.pg-step:focus-visible { text-decoration: underline 2px; text-underline-offset: 6px; }

.pg-step[data-disabled] { opacity: 0.32; cursor: default; }

.pg-arrow {
  width: 44px;
  height: 14px;
  margin-top: 3px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  transition: translate 80ms ease-out;
}

.pg-prev .pg-arrow { rotate: 180deg; }

.pg-step:not([data-disabled]):active { color: var(--red); }
.pg-next:not([data-disabled]):active { translate: 3px 0; }
.pg-prev:not([data-disabled]):active { translate: -3px 0; }
.pg-next:not([data-disabled]):active .pg-arrow { translate: 6px 0; }
.pg-prev:not([data-disabled]):active .pg-arrow { translate: -6px 0; }
