/* The Ledger of Last Words · landing page
   Matte black, bone linework, one arterial red. */

@font-face {
  font-family: "Fell";
  src: url("../fonts/fell-english.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Fell";
  src: url("../fonts/fell-english-italic.woff2") format("woff2");
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

:root {
  --black: #000;
  --bone: #eee2ce;
  --bone-2: rgba(238, 226, 206, .82);
  --bone-3: rgba(238, 226, 206, .56);
  --bone-4: rgba(238, 226, 206, .16);
  --red: #a32420;
  --red-hot: #dc3a2f;
  --bar-h: 0px;
  --col: 33rem;
  --pad: 1.25rem;
  color-scheme: dark;
}
html.has-player { --bar-h: 4.25rem; }

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--black);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: clip;
  scrollbar-color: #2b2722 #000;
}

body {
  margin: 0;
  background: var(--black);
  color: var(--bone-2);
  font-family: "Fell", "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  font-size: clamp(1.14rem, .95rem + .9vw, 1.34rem);
  line-height: 1.62;
  font-weight: 400;
  font-synthesis: none;
  font-kerning: normal;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1, h2, p, ol { margin: 0; }
h1, h2 { font-weight: 400; }
img { max-width: 100%; }

::selection { background: var(--red); color: var(--bone); }

:focus-visible {
  outline: 1px solid var(--bone);
  outline-offset: 4px;
}

.skip {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translate(-50%, -120%);
  padding: .6em 1.2em;
  background: var(--black);
  color: var(--bone);
  border: 1px solid var(--bone-3);
  font-size: .9rem;
  text-decoration: none;
  z-index: 50;
}
.skip:focus { transform: translate(-50%, .6rem); }

/* Small tracked capitals, as on the cover's top and bottom lines. */
.caps {
  font-size: .72rem;
  line-height: 1.5;
  letter-spacing: .4em;
  text-transform: uppercase;
  color: var(--bone-3);
}

/* The red thread. */
.thread {
  display: block;
  width: 1.5px;
  background: var(--red);
  margin: 0 auto;
  border-radius: 1px;
}
@supports (background: color-mix(in srgb, red 10%, blue)) {
  .thread, .play::before {
    background: color-mix(in srgb, var(--red-hot) calc(var(--pulse, 0) * 100%), var(--red));
    box-shadow: 0 0 calc(var(--pulse, 0) * 10px) rgba(220, 58, 47, calc(var(--pulse, 0) * .8));
  }
}

/* ---------- Hero: the cover, at the size of the screen ---------- */

.hero {
  --helm-h: clamp(11rem, 38vh, 27rem);
  --gap: clamp(1.9rem, 6vh, 4rem);
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: max(1.5rem, env(safe-area-inset-top)) var(--pad) 0;
  text-align: center;
}
@supports (height: 100svh) {
  .hero {
    --room: calc(100svh - var(--bar-h));
    --helm-h: clamp(11rem, calc(var(--room) * .385), 27rem);
    --gap: clamp(1.9rem, calc(var(--room) * .06), 4rem);
    min-height: 100svh;
  }
  .hero .title { font-size: clamp(2.5rem, min(11.2vw, calc(var(--room) * .122)), 7.4rem); }
}

.series {
  color: var(--bone-2);
  padding-left: .4em;
}
.series span { display: block; }
.series .dot { display: none; }

.helm {
  position: relative;
  flex: none;
  width: min(64vw, calc(var(--helm-h) * 464 / 478));
  margin: auto 0 var(--gap);
}
.helm picture { display: block; }
.helm-art {
  display: block;
  width: 100%;
  height: auto;
  mix-blend-mode: lighten;
  filter: brightness(calc(1 + var(--flare, 0) * .5));
}
.helm-glow {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  mix-blend-mode: screen;
  opacity: calc(.1 + var(--pulse, 0) * .9);
  pointer-events: none;
}
.thread-helm {
  position: absolute;
  left: 50.4%;
  top: 99.2%;
  height: calc(.8% + var(--gap) - .55rem);
  margin: 0;
  transform: translateX(-50%);
}

.title {
  font-size: clamp(2.5rem, min(11.2vw, 12.5vh), 7.4rem);
  line-height: .98;
  letter-spacing: .014em;
  text-transform: uppercase;
  color: var(--bone);
}
.title span { display: block; }

.author {
  color: var(--bone);
  font-size: .78rem;
  letter-spacing: .5em;
  padding-left: .5em;
}
.hero .author { margin-top: clamp(1.1rem, 3.2vh, 2rem); }

.refusal {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .6rem;
}
.refusal-n { padding-left: .4em; }
.refusal-t {
  font-style: italic;
  font-size: clamp(2.1rem, 7.6vw, 3.5rem);
  line-height: 1.1;
  color: var(--bone);
}
.refusal-cue {
  margin-top: auto;
  padding-top: 1.6rem;
  gap: .35rem;
}
.refusal-cue .refusal-t {
  font-size: clamp(1.3rem, 4.8vw, 1.65rem);
  color: var(--bone-2);
}
.thread-cue {
  flex: none;
  height: calc(1.5rem + var(--bar-h));
  margin-top: .9rem;
}

/* ---------- Sections ---------- */

.sect {
  padding: 0 var(--pad) clamp(3.2rem, 9vh, 6rem);
  text-align: center;
}
.sect > .thread { height: clamp(4.5rem, 15vh, 8.5rem); }
.sect > .refusal { margin-top: 2.3rem; }

.prose {
  max-width: var(--col);
  margin: 2.5rem auto 0;
  text-align: left;
}
.prose p { text-wrap: pretty; }
.prose p + p { margin-top: 1.15em; }

.lead::first-letter {
  float: left;
  font-size: 3.5em;
  line-height: .8;
  padding: .07em .05em 0 0;
  color: var(--bone);
}

.prose .beat {
  margin: 1.5em 0 1.45em;
  text-align: center;
  font-style: italic;
  font-size: 1.75em;
  line-height: 1.15;
  color: var(--bone);
}

/* ---------- The Ledger ---------- */

.ledger {
  list-style: none;
  max-width: var(--col);
  margin: 2.6rem auto 0;
  padding: 0;
  text-align: left;
  border-top: 1px solid var(--bone-4);
}
.entry {
  display: grid;
  gap: .45rem;
  padding: 1.15rem 0 1.3rem;
  border-bottom: 1px solid var(--bone-4);
}
.entry-ref, .blank-n {
  display: block;
  font-size: .8em;
  line-height: 1.4;
  letter-spacing: .05em;
  color: var(--bone-3);
}
.entry-ref .dot { margin: 0 .3em; }
.entry-words {
  display: block;
  text-indent: -.42em;
  font-style: italic;
  font-size: clamp(1.5rem, 5.6vw, 2.05rem);
  line-height: 1.2;
  color: var(--bone);
  quotes: "\201C" "\201D" "\2018" "\2019";
  text-wrap: balance;
}

/* The forty-two lines still blank. The last one is the red one. */
.blank {
  max-width: var(--col);
  margin: 0 auto;
  padding-top: 1.05rem;
  text-align: left;
}
.blank-lines {
  display: grid;
  gap: 7px;
  margin-top: .8rem;
  -webkit-mask-image: linear-gradient(to bottom, #000 0, rgba(0, 0, 0, .28) 100%);
  mask-image: linear-gradient(to bottom, #000 0, rgba(0, 0, 0, .28) 100%);
}
.blank-lines i {
  display: block;
  height: 1px;
  background: var(--bone-4);
}
.blank-end {
  display: block;
  height: 2px;
  margin-top: 7px;
  background: var(--red);
}
.blank-last {
  margin-top: .75rem;
  color: var(--bone-2);
}

.prose .count {
  text-align: center;
  color: var(--bone);
}
.count span { display: block; }
.blank + .prose { margin-top: 2.4rem; }

/* ---------- Coming soon ---------- */

.coming { padding-bottom: clamp(4rem, 12vh, 7rem); }
.coming .series { margin-top: 2.5rem; }
.title-again {
  margin-top: 1.1rem;
  font-size: clamp(2.2rem, min(9.6vw, 10vh), 5rem);
}
.soon {
  display: inline-block;
  margin-top: 2rem;
  padding: .85em 1.5em .85em 2em;
  border: 1px solid var(--bone-3);
  color: var(--bone);
  font-size: .8rem;
  letter-spacing: .5em;
}
.note {
  max-width: 31rem;
  margin: 2rem auto 0;
  font-size: .9em;
  font-style: italic;
  color: var(--bone-3);
  text-wrap: balance;
}
.note-2 { margin-top: .3rem; }

/* ---------- The theme song ---------- */

.player {
  position: sticky;
  bottom: 0;
  z-index: 20;
  background: var(--black);
  padding-bottom: env(safe-area-inset-bottom);
}
.player[hidden] { display: none; }

.seek {
  position: absolute;
  left: 0;
  right: 0;
  top: -10px;
  height: 21px;
}
.seek::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 10px;
  height: 1px;
  background: var(--bone-4);
}
.seek-fill {
  position: absolute;
  left: 0;
  top: 9.5px;
  width: 100%;
  height: 2px;
  background: var(--red);
  transform: scaleX(var(--progress, 0));
  transform-origin: left center;
}
.seek-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.seek-thumb {
  position: absolute;
  top: 6px;
  left: calc(var(--progress, 0) * 100%);
  width: 9px;
  height: 9px;
  margin-left: -4.5px;
  border-radius: 50%;
  background: var(--bone);
  opacity: 0;
  transition: opacity .2s;
  pointer-events: none;
}
.seek:hover .seek-thumb,
.seek-input:focus-visible + .seek-thumb { opacity: 1; }
.seek-input:focus-visible + .seek-thumb { outline: 1px solid var(--bone); outline-offset: 3px; }

.player-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  column-gap: 1.1rem;
  height: 4.25rem;
  max-width: 46rem;
  margin: 0 auto;
  padding: 0 1rem;
}
.player-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  text-align: right;
  line-height: 1.25;
}
.player-label {
  font-size: .56rem;
  letter-spacing: .32em;
  white-space: nowrap;
}
.player-title {
  font-style: italic;
  font-size: 1rem;
  color: var(--bone);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.player-time {
  min-width: 0;
  font-size: .92rem;
  color: var(--bone-3);
  white-space: nowrap;
}
#time-now { color: var(--bone-2); }

.play {
  position: relative;
  display: grid;
  place-items: center;
  width: 2.9rem;
  height: 2.9rem;
  padding: 0;
  border: 1px solid var(--bone-2);
  border-radius: 50%;
  background: var(--black);
  color: var(--bone);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color .25s, color .25s;
}
.play:hover { border-color: var(--bone); }
.play::before {
  /* the thread ends here */
  content: "";
  position: absolute;
  left: 50%;
  bottom: 100%;
  width: 1.5px;
  height: calc((4.25rem - 2.9rem) / 2);
  margin-left: -.75px;
  background: var(--red);
}
.play::after {
  content: "";
  position: absolute;
  inset: -1px;
  border: 1px solid var(--red-hot);
  border-radius: 50%;
  opacity: calc(var(--pulse, 0) * .95);
  transform: scale(calc(1 + var(--pulse, 0) * .2));
  pointer-events: none;
}
.icon { display: block; fill: currentColor; }
.icon-pause { display: none; }
html.playing .icon-play { display: none; }
html.playing .icon-pause { display: block; }
html.loading .play { border-color: var(--bone-3); color: var(--bone-3); }

/* ---------- Footer ---------- */

.foot {
  padding: clamp(2rem, 6vh, 3.5rem) var(--pad) calc(2.4rem + env(safe-area-inset-bottom));
  text-align: center;
}
.foot picture { display: block; }
.frieze {
  display: block;
  width: min(100%, 56rem);
  height: auto;
  margin: 0 auto;
  mix-blend-mode: lighten;
}
.foot-author { margin-top: 1.9rem; }
.legal {
  margin-top: 1.4rem;
  font-size: .76rem;
  letter-spacing: .05em;
  color: var(--bone-3);
}

/* ---------- Not found ---------- */

.lost {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2rem;
  padding: 2rem var(--pad);
  text-align: center;
}
.lost a {
  color: var(--bone);
  text-decoration: none;
  border-bottom: 1px solid var(--red);
  padding-bottom: .15em;
}
.lost a:hover { border-bottom-color: var(--red-hot); }

/* ---------- Wider screens ---------- */

@media (min-width: 40em) {
  .caps { letter-spacing: .44em; }
  .series { padding-left: .44em; }
  .series span { display: inline; }
  .series .dot { display: inline; margin: 0 .35em; }
  .author { font-size: .84rem; }
  .player-label { font-size: .6rem; }
  .player-row { column-gap: 1.5rem; }
}

/* ---------- Short, wide screens: a phone on its side ---------- */

@media (orientation: landscape) and (max-height: 30em) {
  .hero {
    display: grid;
    grid-template-columns: auto auto;
    grid-template-rows: auto 1fr auto auto 1fr;
    justify-content: center;
    align-items: center;
    column-gap: clamp(1.5rem, 5vw, 3.5rem);
    padding-bottom: calc(var(--bar-h) + .75rem);
  }
  .hero .series { grid-column: 1 / -1; justify-self: center; }
  .helm {
    grid-column: 1;
    grid-row: 2 / 6;
    width: min(30vw, calc((100vh - var(--bar-h) - 5rem) * 464 / 478));
    margin: .75rem 0 0;
  }
  .hero .title {
    grid-column: 2;
    grid-row: 3;
    font-size: clamp(2rem, min(7.2vw, 17vh), 4.2rem);
    text-align: left;
  }
  .hero .author {
    grid-column: 2;
    grid-row: 4;
    justify-self: start;
    margin-top: .9rem;
    padding-left: 0;
  }
  .thread-helm, .thread-cue, .refusal-cue { display: none; }
}

/* ---------- Motion ---------- */

@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes emerge {
  from { opacity: 0; transform: scale(.985); }
  to { opacity: 1; transform: none; }
}
@keyframes rise {
  from { opacity: 0; transform: translateY(.3em); }
  to { opacity: 1; transform: none; }
}
@keyframes drip-centered {
  from { transform: translateX(-50%) scaleY(0); }
  to { transform: translateX(-50%) scaleY(1); }
}
@keyframes drip {
  from { transform: scaleY(0); }
  to { transform: scaleY(1); }
}
@keyframes breathe {
  0%, 100% { opacity: .04; }
  50% { opacity: .46; }
}

@media (prefers-reduced-motion: no-preference) {
  .hero .series { animation: fade 1.4s .1s both; }
  .helm-art { animation: emerge 1.9s .15s both cubic-bezier(.2, .7, .2, 1); }
  .thread-helm { transform-origin: top center; animation: drip-centered 1s 1.3s both cubic-bezier(.5, 0, .2, 1); }
  .hero .title { animation: rise 1.3s 1.8s both cubic-bezier(.2, .7, .2, 1); }
  .hero .author { animation: fade 1.3s 2.3s both; }
  .refusal-cue { animation: fade 1.5s 2.8s both; }
  .thread-cue { transform-origin: top center; animation: drip 1.1s 3.2s both cubic-bezier(.5, 0, .2, 1); }

  html:not(.playing) .helm-glow { animation: breathe 6.5s 2.2s ease-in-out infinite both; }

  /* Sections arrive as they are scrolled to. Only when the script is running. */
  html.js .reveal {
    opacity: 0;
    transform: translateY(.9rem);
    transition: opacity 1.1s ease, transform 1.1s cubic-bezier(.2, .7, .2, 1);
  }
  html.js .reveal.in {
    opacity: 1;
    transform: none;
  }
  html.js .thread.reveal {
    opacity: 1;
    transform: scaleY(0);
    transform-origin: top center;
    transition: transform 1.3s cubic-bezier(.5, 0, .2, 1);
  }
  html.js .thread.reveal.in { transform: scaleY(1); }
}

@media print {
  .player, .thread, .helm-glow { display: none; }
  body { background: #fff; color: #000; }
}


/* ---------- The teaser: a screen behind a cracked veil ---------- */

.look .refusal-t { color: var(--bone); }
.screen {
  position: relative;
  width: min(100%, 60rem);
  margin: 2.6rem auto 0;
  aspect-ratio: 16 / 9;
  background: var(--black);
  overflow: hidden;
  box-shadow: 0 0 0 1px var(--bone-4);
}
.screen-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--black);
}
.veil {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--bone);
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.veil-half {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50.5%;
  background: var(--black);
  transition: transform 1.6s cubic-bezier(.7, 0, .2, 1);
}
.veil-l { left: 0; transform: translateX(var(--part, 0)); }
.veil-r { right: 0; transform: translateX(calc(var(--part, 0) * -1)); }
.veil-crack {
  position: absolute;
  left: 50%;
  top: 8%;
  bottom: 8%;
  width: 2px;
  transform: translateX(-50%);
  background: var(--red);
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 82%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 18%, #000 82%, transparent);
  box-shadow: 0 0 12px rgba(220, 58, 47, .55);
  transition: opacity .8s ease;
}
.veil-word {
  position: absolute;
  left: 50%;
  bottom: 9%;
  transform: translateX(-50%);
  padding-left: .55em;
  font-size: .78rem;
  letter-spacing: .55em;
  text-transform: uppercase;
  color: var(--bone-3);
  transition: color .4s ease, opacity .8s ease;
}
/* A hand on the veil opens a slit, the way a crack would. */
.veil:hover, .veil:focus-visible { --part: -2.2%; }
.veil:hover .veil-word, .veil:focus-visible .veil-word { color: var(--bone); }
.veil:focus-visible { outline: 1px solid var(--bone-3); outline-offset: -1px; }
.screen.open .veil { --part: -51%; pointer-events: none; }
.screen.open .veil-crack, .screen.open .veil-word { opacity: 0; }
.screen.gone .veil { display: none; }
.screen-note { margin-top: 1.2rem; }

/* ---------- The page breathes: eight breaths and a held ninth ---------- */

.dread {
  position: fixed;
  inset: 0;
  z-index: 15;
  pointer-events: none;
  background: radial-gradient(ellipse at 50% 45%, transparent 52%, rgba(0, 0, 0, .78) 100%);
  opacity: .5;
}
.dread::after {
  content: "";
  position: absolute;
  inset: -50%;
  opacity: .07;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .93 0 0 0 0 .88 0 0 0 0 .8 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
@media (prefers-reduced-motion: no-preference) {
  .dread { animation: recital 40.5s linear infinite; }
  .dread::after { animation: grain .9s steps(6) infinite; }
}
@keyframes recital {
  0%, 11.1%, 22.2%, 33.3%, 44.4%, 55.5%, 66.6%, 77.7%, 88.8%, 100% { opacity: .42; }
  5.5%, 16.6%, 27.7%, 38.8%, 49.9%, 61%, 72.1%, 83.2% { opacity: .7; }
}
@keyframes grain {
  0% { transform: translate(0, 0); }
  20% { transform: translate(-7%, 4%); }
  40% { transform: translate(5%, -6%); }
  60% { transform: translate(-3%, -8%); }
  80% { transform: translate(8%, 3%); }
  100% { transform: translate(0, 0); }
}

/* ---------- Something kind, when you stop moving ---------- */

.whisper {
  position: fixed;
  left: 50%;
  bottom: calc(var(--bar-h) + 2.2rem + env(safe-area-inset-bottom));
  z-index: 31;
  width: max-content;
  max-width: calc(100% - 2 * var(--pad));
  transform: translateX(-50%);
  font-style: italic;
  font-size: clamp(1.05rem, 3.6vw, 1.3rem);
  color: var(--bone-2);
  text-align: center;
  pointer-events: none;
  opacity: 0;
  transition: opacity 3.5s ease;
}
.whisper.on { opacity: .82; }

.note-kindle { margin-top: 1.2rem; }

/* ---------- Recovered papers: praise, as the empire filed it ---------- */

.papers {
  list-style: none;
  max-width: 44rem;
  margin: 2.6rem auto 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr;
  border-top: 1px solid var(--bone-4);
}
@media (min-width: 48em) {
  .papers { grid-template-columns: 1fr 1fr; column-gap: 3rem; }
  .paper-lead { grid-column: 1 / -1; }
}
.paper {
  position: relative;
  padding: 1.5rem 0 1.4rem;
  border-bottom: 1px solid var(--bone-4);
  text-align: left;
}
.paper-words { margin: 0; }
.paper-words p {
  font-style: italic;
  font-size: clamp(1.15rem, 4.2vw, 1.4rem);
  line-height: 1.3;
  color: var(--bone);
  text-indent: -.42em;
  text-wrap: pretty;
}
.paper-words p::before { content: "\201C"; }
.paper-words p::after { content: "\201D"; }
.paper-from {
  margin-top: .7rem;
  font-size: .68rem;
  line-height: 1.6;
  letter-spacing: .28em;
  text-transform: uppercase;
  color: var(--bone-3);
}
.paper-from::before {
  content: "";
  display: inline-block;
  width: 1.4rem;
  height: 1.5px;
  margin: 0 .7rem .25em 0;
  background: var(--red);
  vertical-align: middle;
}
.paper-lead { padding: 2rem 0 1.9rem; text-align: center; }
.paper-lead .paper-words p {
  font-size: clamp(1.6rem, 6.4vw, 2.5rem);
  line-height: 1.15;
  text-indent: 0;
  text-wrap: balance;
}
.paper-lead .paper-from::before { display: none; }
.clerk {
  margin-top: 1.8rem;
  font-size: .62rem;
  letter-spacing: .32em;
  color: rgba(238, 226, 206, .34);
}
@media (min-width: 48em) {
  .paper:last-child .paper-from::before { display: none; }
}

.poster-link { margin-top: 2rem; }
.poster-link a {
  color: var(--bone-2);
  text-decoration: none;
  border-bottom: 1px solid var(--red);
  padding: 0 0 .3em .4em;
}
.poster-link a:hover, .poster-link a:focus-visible { color: var(--bone); }

.paper { padding-left: 1.1rem; border-left: 1.5px solid var(--red); border-bottom: 0; margin-top: 1.4rem; }
.papers { border-top: 0; row-gap: .4rem; }
.paper-lead { border-left: 0; padding-left: 0; text-align: center; margin-top: .6rem; }

.paper-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: .2rem .9rem; margin-bottom: .55rem; }
.paper-lead .paper-head { justify-content: center; }
.paper-kind { font-size: .66rem; letter-spacing: .32em; color: var(--bone-2); }
.stars { color: var(--red-hot); letter-spacing: .18em; font-size: .9rem; font-style: normal; }
.paper-words em, .paper-words cite { font-style: normal; }
.reviews-note { margin-top: 1.8rem; font-size: .8em; }

/* ================= THE REWORK: a page that knows you are here ================= */

/* ---------- The gate ---------- */

.gate { display: none; }
html.gated { overflow: hidden; }
html.gated body { overflow: hidden; }
html.gated .gate {
  display: flex;
}
.gate {
  position: fixed;
  inset: 0;
  z-index: 60;
  align-items: center;
  justify-content: center;
  padding: max(1.5rem, env(safe-area-inset-top)) var(--pad) max(1.5rem, env(safe-area-inset-bottom));
  text-align: center;
  --hold: 0;
}
.gate.gone { display: none !important; }
.gate-half {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50.5%;
  background: #000;
  transition: transform 2s cubic-bezier(.75, 0, .2, 1);
}
.gate-l { left: 0; }
.gate-r { right: 0; }
.gate-half::after {
  /* the faint glow of something behind the seam */
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 70% at 100% 50%, rgba(163, 36, 32, calc(.04 + var(--hold) * .22)), transparent 70%);
}
.gate-r::after { background: radial-gradient(ellipse 60% 70% at 0% 50%, rgba(163, 36, 32, calc(.04 + var(--hold) * .22)), transparent 70%); }
.gate-crack {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 2px;
  margin-left: -1px;
  background: var(--red-hot);
  box-shadow: 0 0 calc(6px + var(--hold) * 26px) rgba(220, 58, 47, .85);
  transform: scaleY(var(--hold));
  transform-origin: top center;
  opacity: calc(.2 + var(--hold) * .8);
}
.gate-inner {
  position: relative;
  max-width: 30rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: opacity .9s ease, filter .9s ease;
}
.gate-cap { margin-bottom: 2.6rem; padding-left: .4em; }
.gate-line {
  font-style: italic;
  font-size: clamp(1.3rem, 5.2vw, 1.75rem);
  line-height: 1.3;
  color: var(--bone);
  text-wrap: balance;
}
.gate-time { font-style: normal; font-size: clamp(1rem, 3.8vw, 1.15rem); color: var(--bone-3); margin-bottom: 1.4rem; }
.gate-b { margin-top: .3rem; color: var(--red-hot); }
.gate-hold {
  position: relative;
  display: grid;
  place-items: center;
  width: 8.5rem;
  height: 8.5rem;
  margin-top: 2.8rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, .6);
  color: var(--bone);
  font: inherit;
  cursor: pointer;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
  transform: scale(calc(1 - var(--hold) * .06));
}
.gate-ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.gate-ring circle { fill: none; stroke-width: 1.2; }
.ring-bg { stroke: var(--bone-4); }
.ring-fill {
  stroke: var(--red-hot);
  stroke-width: 2;
  stroke-dasharray: 100;
  stroke-dashoffset: calc(100 - var(--hold) * 100);
}
.gate-word {
  font-size: .64rem;
  letter-spacing: .34em;
  padding-left: .34em;
  text-transform: uppercase;
  color: var(--bone-2);
  max-width: 6.5rem;
  line-height: 1.6;
}
.gate-hold:focus-visible { outline: 1px solid var(--bone-3); outline-offset: 6px; }
.gate-how {
  margin-top: 1.5rem;
  font-size: .86rem;
  font-style: italic;
  color: var(--bone-3);
}
.gate-quiet {
  margin-top: 2.2rem;
  padding: .4em .2em;
  border: 0;
  background: none;
  color: rgba(238, 226, 206, .38);
  font: inherit;
  font-size: .78rem;
  letter-spacing: .08em;
  text-decoration: underline;
  text-decoration-color: rgba(163, 36, 32, .6);
  text-underline-offset: .3em;
  cursor: pointer;
}
.gate-quiet:hover, .gate-quiet:focus-visible { color: var(--bone-2); }
.gate.holding .gate-inner > :not(.gate-hold) { opacity: .25; transition: opacity 2.4s ease; }
.gate.open .gate-l { transform: translateX(-101%); }
.gate.open .gate-r { transform: translateX(101%); }
.gate.open .gate-inner { opacity: 0; filter: blur(4px); }
.gate.open .gate-crack { opacity: 0; transition: opacity .5s ease .2s; }

@media (prefers-reduced-motion: no-preference) {
  html.js .gate-inner > * { animation: fade 1.8s both; }
  html.js .gate-time { animation-delay: .6s; }
  html.js #gate-a { animation-delay: 2s; }
  html.js .gate-b { animation-delay: 3.6s; }
  html.js .gate-hold { animation: fade 1.6s 4.6s both; }
  html.js .gate-how { animation-delay: 5.2s; }
  html.js .gate-quiet { animation-delay: 6.4s; }
  .gate.holding .gate-hold { animation: shiver .09s steps(2) infinite; }
  /* Everything behind the gate waits for it. */
  html.gated .hero *, html.gated .hero { animation-play-state: paused !important; }
}
@keyframes shiver {
  0% { translate: 0 0; }
  50% { translate: calc(var(--hold) * 1.4px) calc(var(--hold) * -1px); }
  100% { translate: calc(var(--hold) * -1px) calc(var(--hold) * 1px); }
}

/* ---------- Sound toggle ---------- */

.hush {
  position: fixed;
  top: max(.8rem, env(safe-area-inset-top));
  right: max(.8rem, env(safe-area-inset-right));
  z-index: 32;
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .5rem .7rem;
  border: 0;
  background: rgba(0, 0, 0, .55);
  color: var(--bone-3);
  font: inherit;
  font-size: .6rem;
  letter-spacing: .32em;
  text-transform: uppercase;
  cursor: pointer;
}
.hush[hidden] { display: none; }
.hush-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1px solid var(--bone-3);
}
.hush.on { color: var(--bone-2); }
.hush.on .hush-dot { background: var(--red-hot); border-color: var(--red-hot); box-shadow: 0 0 8px rgba(220, 58, 47, .8); }
@media (prefers-reduced-motion: no-preference) {
  .hush.on .hush-dot { animation: heartdot 1.6s ease-in-out infinite; }
}
@keyframes heartdot { 0%, 30%, 100% { opacity: 1; } 12% { opacity: .35; } }

/* ---------- The dark follows you and closes in as you go deeper ---------- */

.dread {
  background: radial-gradient(ellipse 120% 95% at var(--vx, 50%) var(--vy, 45%),
    transparent calc(34% - var(--depth, 0) * 16%),
    rgba(0, 0, 0, calc(.55 + var(--depth, 0) * .3)) calc(78% - var(--depth, 0) * 12%),
    rgba(0, 0, 0, .96) 100%);
}
.dread::after { opacity: calc(.06 + var(--depth, 0) * .07); }
@media (pointer: fine) {
  .dread { background: radial-gradient(circle at var(--vx, 50%) var(--vy, 45%),
    transparent calc(16rem - var(--depth, 0) * 5rem),
    rgba(0, 0, 0, calc(.5 + var(--depth, 0) * .3)) calc(44rem - var(--depth, 0) * 12rem),
    rgba(0, 0, 0, .95) 100%); }
}

/* The helm notices you coming closer. */
.helm-glow { opacity: calc(.1 + var(--pulse, 0) * .9 + var(--near, 0) * .55); }
.helm-art { filter: brightness(calc(1 + var(--flare, 0) * .5 + var(--near, 0) * .12)); }
@media (prefers-reduced-motion: no-preference) {
  .helm picture { animation: helm-breathe 4.5s ease-in-out infinite; transform-origin: 50% 60%; }
}
@keyframes helm-breathe { 0%, 100% { transform: scale(1); } 45% { transform: scale(1.012); } }

/* ---------- The drill, chanted under everything ---------- */

.drill {
  overflow: hidden;
  white-space: nowrap;
  margin: clamp(2.5rem, 8vh, 4.5rem) 0 0;
  font-size: .62rem;
  letter-spacing: .5em;
  text-transform: uppercase;
  color: rgba(163, 36, 32, .55);
  -webkit-mask-image: linear-gradient(to right, transparent, #000 20%, #000 80%, transparent);
  mask-image: linear-gradient(to right, transparent, #000 20%, #000 80%, transparent);
}
.drill span { display: inline-block; }
@media (prefers-reduced-motion: no-preference) {
  .drill span { animation: march 70s linear infinite; }
  .drill-2 span { animation-direction: reverse; animation-duration: 90s; }
}
@keyframes march { from { transform: translateX(0); } to { transform: translateX(-50%); } }

/* ---------- The Ledger speaks, then the hammer ---------- */

.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}
.entry-words.waiting::before, .entry-words.waiting::after { opacity: 0; transition: opacity .6s; }
.entry-words.speaking::before { opacity: 1; }
.entry-words.struck::after { opacity: 1; transition: none; }
.sw { opacity: 0; filter: blur(5px); transition: opacity .9s ease, filter 1.2s ease; }
.sw.said { opacity: 1; filter: none; }
.entry-words.struck { color: var(--bone); text-shadow: 0 0 18px rgba(163, 36, 32, .5); }

.cut {
  position: fixed;
  inset: 0;
  z-index: 45;
  display: grid;
  place-items: center;
  background: #000;
  opacity: 0;
  pointer-events: none;
}
.cut img { width: min(70vw, 34rem); height: auto; opacity: 0; mix-blend-mode: screen; }
.cut.on { opacity: 1; }
.cut.flash img { opacity: .55; }

/* ---------- The line written while you were away ---------- */

.written {
  display: block;
  min-height: 0;
  font-style: italic;
  color: var(--red-hot);
  font-size: clamp(1.15rem, 4.4vw, 1.5rem);
  line-height: 1.3;
}
.blank.inked .written { margin-top: .45rem; }
@media (prefers-reduced-motion: no-preference) {
  .blank.inked .written { animation: ink 5s ease both; }
}
@keyframes ink {
  0% { opacity: 0; filter: blur(8px); letter-spacing: .2em; }
  60% { opacity: .9; filter: blur(1px); }
  100% { opacity: 1; filter: none; letter-spacing: 0; }
}

/* ---------- Words that are not always the words ---------- */

.w.wrong { color: var(--red-hot); }
@media (max-width: 47.99em) {
  .hush {
    top: auto;
    bottom: calc(var(--bar-h) + .9rem + env(safe-area-inset-bottom));
    right: .7rem;
    padding: .7rem;
    border-radius: 50%;
  }
  .hush-word { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
}

/* ================= Second wave ================= */

/* The tether: how far down you have gone, belt to belt. */
.tether {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  z-index: 16;
  pointer-events: none;
  background: rgba(238, 226, 206, .05);
}
.tether-fill {
  display: block;
  height: 100%;
  background: var(--red);
  transform: scaleY(var(--depth, 0));
  transform-origin: top center;
  box-shadow: 0 0 8px rgba(220, 58, 47, .45);
}
html.gated .tether { display: none; }

/* Something a little behind your pointer. */
.follower {
  position: fixed;
  left: -4px;
  top: -4px;
  z-index: 33;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: 1px solid rgba(220, 58, 47, .7);
  pointer-events: none;
  opacity: 0;
  transition: opacity .8s ease;
  will-change: transform;
}
.follower.on { opacity: .8; }
html.gated .follower { display: none; }

/* Eyes, in the dark at the edge, when you have been still. */
.eyes {
  position: fixed;
  z-index: 16;
  display: flex;
  gap: 14px;
  transform: translate(-50%, -50%);
  pointer-events: none;
  opacity: 0;
  transition: opacity 4s ease;
}
.eyes i {
  display: block;
  width: 9px;
  height: 4px;
  border-radius: 50%;
  background: var(--bone);
  box-shadow: 0 0 6px rgba(238, 226, 206, .7);
  transform: scaleY(.15);
  transition: transform 2.5s ease;
}
.eyes.open { opacity: .55; }
.eyes.open i { transform: scaleY(1); animation: blink 7s 3s infinite; }
.eyes:not(.open) { transition: opacity .25s ease; }
@keyframes blink { 0%, 94%, 100% { transform: scaleY(1); } 96% { transform: scaleY(.1); } }

/* Line 10,000 is spoken for. */
.blank-last.kept { color: var(--red-hot); letter-spacing: .08em; }
.blank { cursor: default; }

.stay { margin-top: 2.4rem; font-size: .8em; color: rgba(238, 226, 206, .4); min-height: 1.4em; }
.up { margin-top: 1.4rem; }
.up a {
  font-style: italic;
  font-size: .9em;
  color: var(--bone-3);
  text-decoration: none;
  border-bottom: 1px solid rgba(163, 36, 32, .6);
  padding-bottom: .15em;
}
.up a:hover, .up a:focus-visible { color: var(--bone); }

/* Ledger lines tremble under a hand. */
@media (prefers-reduced-motion: no-preference) and (pointer: fine) {
  .entry:hover .entry-words { animation: tremble .12s steps(2) infinite; }
}
@keyframes tremble { 0% { translate: 0 0; } 50% { translate: .6px -.4px; } 100% { translate: -.5px .5px; } }

/* No written copies. */
@media print {
  html, body { background: #fff !important; }
  body > *, main, .foot { display: none !important; }
  html::after {
    content: "Owning a written copy is a burning offense.";
    display: block;
    padding: 40vh 2rem 0;
    text-align: center;
    font: italic 20pt "Fell", Georgia, serif;
    color: #000;
  }
}

/* Recovered papers: the rhyme stops one word short, with no closing mark. */
.paper-rhyme .paper-words p::before, .paper-rhyme .paper-words p::after { content: none; }
.paper-rhyme .paper-words p { font-size: clamp(1.3rem, 5vw, 1.9rem); line-height: 1.35; }
.paper-words p { text-indent: 0; }
.paper:not(.paper-lead) .paper-words p { font-size: clamp(1.05rem, 3.8vw, 1.2rem); line-height: 1.45; }

/* ---------- Buy ---------- */
.buy { margin-top: 2rem; }
.buy .soon { margin-top: 0; }
.soon-buy {
  text-decoration: none;
  border-color: var(--red);
  transition: background-color .25s ease, color .25s ease;
}
.soon-buy:hover, .soon-buy:focus-visible { background: var(--red); color: var(--bone); outline: none; }
