@font-face {
  font-family: "Manifesto Digits";
  src: url("fonts/manifesto-digits.woff2") format("woff2");
  font-display: swap;
}

@font-face {
  font-family: Charter;
  src: url("fonts/charter-regular.woff2") format("woff2");
  font-display: swap;
}

@font-face {
  font-family: Charter;
  src: url("fonts/charter-italic.woff2") format("woff2");
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: Charter;
  src: url("fonts/charter-bold.woff2") format("woff2");
  font-weight: 700;
  font-display: swap;
}

body {
  max-width: 38rem;
  margin: 8px auto;
  padding-inline: 8px;
  background-color: #c0c0c0;
  color: #000;
  font-family: "Times New Roman", Times, serif;
  font-size: 1.0625rem;
  line-height: 1.45;
}

main {
  font-family: Charter, "Times New Roman", Times, serif;
  line-height: 1.5625rem;
}

main p { text-indent: 4ch; }

.manifesto-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) min(65%, 384px) minmax(0, 1fr);
  align-items: center;
  column-gap: clamp(4px, 1vw, 5px);
  margin: 1.25rem 0 1rem;
}

.manifesto-title img,
.guestbook-decoration img {
  display: block;
  max-width: 100%;
  height: auto;
  margin-inline: auto;
  image-rendering: pixelated;
}

.preface {
  margin-bottom: 1.5rem;
  font: 0.875rem/1.4 Menlo, Consolas, monospace;
}

.preface p {
  margin: 0.45rem 0;
}

.preface-credit {
  margin: 1rem 0 0.75rem;
  text-align: center;
}

.preface-rule {
  overflow: hidden;
  white-space: nowrap;
}

.narration {
  width: 100%;
  margin: 0 auto 1.5rem;
  box-sizing: border-box;
  border: 1px solid;
  border-color: #fff #404040 #404040 #fff;
  background: #c0c0c0;
  color: #202020;
  box-shadow: inset 1px 1px #dfdfdf, inset -1px -1px #808080;
  font: 0.75rem/1.25 Arial, sans-serif;
}

.narration audio { width: 100%; }
.narration audio:not([controls]) { display: none; }

.narration-controls {
  padding: 2px 4px 4px;
}

.narration-transport,
.narration-skip,
.narration-level {
  display: flex;
  align-items: center;
  gap: 2px;
}

.narration-transport button {
  display: grid;
  place-items: center;
  width: 23px;
  height: 23px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 0;
  background: #c0c0c0;
  color: #242424;
}

.narration-transport button svg {
  width: 12px;
  height: 12px;
  fill: currentColor;
  shape-rendering: crispEdges;
}

.narration-transport button:hover:not(:disabled) {
  border-color: #fff #808080 #808080 #fff;
  box-shadow: inset -1px -1px #a0a0a0;
}

.narration-transport .narration-stop,
.narration-transport button:active:not(:disabled) {
  border-color: #808080 #fff #fff #808080;
  box-shadow: inset 1px 1px #a0a0a0;
}

.narration-transport button:disabled { color: #6e6e6e; }
.narration-controls :focus-visible { outline: 1px dashed #222; outline-offset: 1px; }

.narration-skip,
.narration-level {
  padding-left: 4px;
  border-left: 1px solid #808080;
  box-shadow: inset 1px 0 #fff;
}

.narration-level { margin-left: auto; gap: 4px; }

.narration-level img {
  display: block;
  image-rendering: pixelated;
}

.narration-controls input[type="range"] {
  appearance: none;
  display: block;
  height: 21px;
  margin: 0;
  background: transparent;
}

.narration-controls input::-webkit-slider-runnable-track {
  height: 8px;
  background: #b2b2b2;
  box-shadow: inset 0 1px #555, inset 1px 2px #929292, inset -1px -1px #fff;
}

.narration-controls input::-moz-range-track {
  height: 8px;
  background: #b2b2b2;
  box-shadow: inset 0 1px #555, inset 1px 2px #929292, inset -1px -1px #fff;
}

.narration-controls input::-webkit-slider-thumb {
  appearance: none;
  box-sizing: border-box;
  width: 9px;
  height: 14px;
  margin-top: -3px;
  border: 1px solid;
  border-color: #fff #333 #333 #fff;
  background: #c0c0c0;
  box-shadow: inset -1px -1px #808080;
}

.narration-controls input::-moz-range-thumb {
  box-sizing: border-box;
  width: 9px;
  height: 14px;
  border: 1px solid;
  border-color: #fff #333 #333 #fff;
  border-radius: 0;
  background: #c0c0c0;
  box-shadow: inset -1px -1px #808080;
}

.narration-seek { width: 100%; }
.narration-volume { width: 42px; }

.narration-volume-control { position: relative; }

.narration-volume-ramp {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.narration-controls .narration-volume { position: relative; }

.narration-controls .narration-volume::-webkit-slider-runnable-track {
  height: 14px;
  background: transparent;
  box-shadow: none;
}

.narration-controls .narration-volume::-moz-range-track {
  height: 14px;
  background: transparent;
  box-shadow: none;
}

.narration-controls .narration-volume::-webkit-slider-thumb { margin-top: 0; }

.narration-error { margin: 0.35rem 0 0; }
.narration-error:empty { display: none; }

a:link { color: #0000ee; }
a:visited { color: #551a8b; }
a:active { color: #8b0000; }

.page-views {
  margin: 1.15rem 0;
  text-align: center;
  font: 0.875rem/1.5 Menlo, Consolas, monospace;
  text-transform: uppercase;
}

.page-view-label {
  display: block;
  margin-bottom: 0.35rem;
  letter-spacing: 0.18em;
}

.page-view-digits {
  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: fit-content;
  max-width: 100%;
  margin: 0 auto;
  padding: 3px;
  border: 3px solid;
  border-color: #686868 #e5e5e5 #efefef #818181;
  background: #030503;
  box-shadow: inset 1px 1px 2px #000;
  forced-color-adjust: none;
}

.page-view-digits::before,
.page-view-value {
  grid-area: 1 / 1;
  font: 17px/1 "Manifesto Digits", monospace;
  letter-spacing: 2px;
  margin-inline-end: -3px; /* Trim the final gap: 1px in the font plus 2px of letter spacing. */
  white-space: nowrap;
}

.page-view-digits::before {
  content: attr(data-unlit);
  color: #21571a;
}

.page-view-value {
  color: #47fa2b;
}

.back-to-top {
  margin: 2.25rem 0 2.75rem;
  text-align: center;
}

@property --button-x {
  syntax: "<percentage>";
  inherits: false;
  initial-value: 50%;
}

@property --button-y {
  syntax: "<percentage>";
  inherits: false;
  initial-value: 50%;
}

@property --button-glow {
  syntax: "<number>";
  inherits: false;
  initial-value: 0;
}

.back-to-top a {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.65rem 1.25rem 0.65rem 0.7rem;
  border: 1px solid #ede3ff;
  border-radius: 999px;
  background:
    radial-gradient(
      ellipse 6rem 4rem at var(--button-x, 50%) var(--button-y, 50%),
      rgb(255 157 234 / calc(0.38 * var(--button-glow, 0))),
      rgb(153 153 255 / calc(0.29 * var(--button-glow, 0))) 55%,
      transparent
    ),
    linear-gradient(110deg, #4338ca, #713ad1 55%, #a12482);
  box-shadow:
    inset 0 1px 1px #ffffff80,
    0 0 0 4px #bc9cff50,
    0 16px 36px #7432dc77;
  color: #fff;
  font: 700 1rem/1.2 system-ui, sans-serif;
  letter-spacing: 0.12em;
  text-decoration: none;
  text-transform: uppercase;
}

.back-to-top-icon {
  position: relative;
  isolation: isolate;
  display: grid;
  width: 2rem;
  height: 2rem;
  place-items: center;
  border: 1px solid #ffffff50;
  border-radius: 50%;
  background: #ffffff25;
}

.back-to-top a:is(:hover, :focus-visible) {
  box-shadow:
    inset 0 1px 1px #ffffff80,
    0 0 0 5px #bc9cff66,
    0 20px 42px #7432dc99;
}

.back-to-top a:focus-visible {
  outline: 3px solid #000;
  outline-offset: 5px;
}

@media (prefers-reduced-motion: no-preference) {
  .back-to-top a {
    position: relative;
    transition: transform 180ms ease-out, box-shadow 180ms ease-out,
      --button-x 110ms ease-out, --button-y 110ms ease-out, --button-glow 220ms ease-out;
  }

  .back-to-top a:is(:hover, :focus-visible) {
    transform: translateY(-4px) scale(1.04);
  }

  .back-to-top a:is(:hover, :focus-visible)::after {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(115deg, transparent 30%, #ffffff66 50%, transparent 70%) no-repeat;
    background-size: 55% 100%;
    content: "";
    pointer-events: none;
    animation: button-sheen 650ms ease-out both;
  }

  .back-to-top-icon::before {
    position: absolute;
    z-index: -1;
    inset: 0;
    border-radius: inherit;
    background: #f3dfff;
    content: "";
    pointer-events: none;
    animation: button-ping 1.4s cubic-bezier(0, 0, 0.2, 1) infinite;
  }

  .back-to-top a:is(:hover, :focus-visible) .back-to-top-icon svg {
    animation: button-arrow 650ms ease-out;
  }

  .back-to-top a:active {
    transform: translateY(1px) scale(0.98);
  }
}

@media (any-hover: hover) and (prefers-reduced-motion: no-preference) {
  .back-to-top a:hover { --button-glow: 1; }
}

@keyframes button-sheen {
  from { background-position: -130% center; }
  to { background-position: 230% center; }
}

@keyframes button-ping {
  from { transform: scale(1); opacity: 0.4; }
  75%, 100% { transform: scale(2); opacity: 0; }
}

@keyframes button-arrow {
  45% { transform: translateY(-3px); }
}

.site-footer {
  margin: 0 0 1rem;
  text-align: center;
}

.guestbook-decoration {
  display: block;
  margin-top: 0.5rem;
}

.hosting-credit {
  margin: 0.5rem 0 0;
  color: #900;
  font-size: 0.875rem;
  font-weight: bold;
}

.hosting-credit a { color: #005500; }
.hosting-credit img { vertical-align: -3px; }

@media print {
  body { max-width: none; background: #fff; }
  .back-to-top, .page-views, .site-footer, .narration { display: none; }
}
