/* Steven Bremel, version 21: Zine. The landing: one stapled zine on a cutting mat. */

html, body { height: 100%; }
html:has(body.home) { overscroll-behavior: none; }
body.home {
  overscroll-behavior: none;
  margin: 0;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  color: var(--white);
  font-family: var(--f-type);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

/* Bars on the mat. */
.bar {
  position: relative;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px max(16px, 2.6vw);
  min-height: 58px;
}
.bar-top { justify-content: space-between; padding-top: max(10px, env(safe-area-inset-top)); }
.bar-bot { justify-content: center; padding-bottom: max(10px, env(safe-area-inset-bottom)); }

.brand, .basket {
  display: inline-block;
  font-family: var(--f-type);
  color: var(--ink);
  background: var(--white);
  padding: .38em .72em .3em;
  text-decoration: none;
  line-height: 1.1;
  box-shadow: 0 2px 0 rgba(0, 0, 0, .35);
}
.brand { font-size: 16px; letter-spacing: .04em; transform: rotate(-1.6deg); }
.basket { font-size: 14px; transform: rotate(1.4deg); background: var(--marker); }
.basket[hidden] { display: none; }

.ctl {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  margin: 0;
  font: inherit;
  font-size: 16px;
  line-height: 1;
  min-height: 46px;
  min-width: 50px;
  padding: 0 16px;
  background: var(--white);
  color: var(--ink);
  transform: rotate(var(--r, 0deg));
  box-shadow: 0 2px 0 rgba(0, 0, 0, .38);
  cursor: pointer;
  touch-action: manipulation;
}
.ctl span { font-size: 22px; line-height: 1; }
.ctl-prev { --r: -2deg; }
.ctl-next { --r: 1.6deg; }
.ctl-toc { --r: -.8deg; background: var(--marker); letter-spacing: .03em; }
.ctl[disabled] { opacity: .38; cursor: default; }
.ctl:not([disabled]):hover { transform: rotate(var(--r, 0deg)) translateY(-2px); }
.ctl:focus-visible, .brand:focus-visible { outline: 3px solid var(--marker); outline-offset: 4px; }
.where {
  min-width: 12em;
  text-align: center;
  font-size: 14px;
  letter-spacing: .03em;
  color: rgba(251, 250, 245, .88);
}

/* The stage and the zine. */
.stage {
  position: relative;
  min-height: 0;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  touch-action: pinch-zoom;
}
.stage.single { overflow: hidden; }
@supports (overflow: clip) {
  .stage.single { overflow-x: clip; overflow-y: visible; }
}

.book {
  position: relative;
  flex: 0 0 auto;
  width: calc(var(--pw) * 2);
  height: var(--ph);
  perspective: calc(var(--pw) * 3.8);
  perspective-origin: 50% 50%;
  transition: transform .72s cubic-bezier(.33, .7, .2, 1);
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}
.book.single { width: var(--pw); }
.book.is-closed { transform: translateX(calc(var(--pw) * -.5)); }
.book.is-end { transform: translateX(calc(var(--pw) * .5)); }

.book-sh {
  position: absolute;
  top: .7%;
  bottom: .2%;
  left: 0;
  right: 0;
  box-shadow: 0 2px 5px rgba(0, 0, 0, .38), 0 24px 50px rgba(0, 0, 0, .42);
  transition: left .72s cubic-bezier(.33, .7, .2, 1), right .72s cubic-bezier(.33, .7, .2, 1);
}
.is-closed .book-sh { left: 50%; }
.is-end .book-sh { right: 50%; }

.edge {
  position: absolute;
  top: .5%;
  bottom: .5%;
  width: var(--n, 0px);
  background: repeating-linear-gradient(90deg, #f1eee6 0 1px, #a39e94 1px 1.8px);
}
.edge-r { left: 100%; }
.edge-l { right: 100%; }
.is-closed .edge-r { left: 100%; }

.leaf {
  position: absolute;
  top: 0;
  left: var(--pw);
  width: var(--pw);
  height: var(--ph);
  transform-origin: 0 50%;
  transform-style: preserve-3d;
}
.single .leaf { left: 0; }

.face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
.face.back { transform: rotateY(180deg); }
.face::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 9;
  pointer-events: none;
}
.face.front::after {
  background: linear-gradient(90deg, rgba(0, 0, 0, .34), rgba(0, 0, 0, .1) 60%, rgba(0, 0, 0, .04));
  opacity: calc(var(--p, 0) * 1.5);
}
.face.back::after {
  background: linear-gradient(270deg, rgba(0, 0, 0, .34), rgba(0, 0, 0, .1) 60%, rgba(0, 0, 0, .04));
  opacity: calc((1 - var(--p, 0)) * 1.5);
}
.two .face.is-r { cursor: e-resize; }
.two .face.is-l { cursor: w-resize; }

/* A page. Everything inside is measured in page units: --u is one hundredth of the width. */
.pg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background-color: var(--paper);
  color: var(--ink);
  font-family: var(--f-type);
  --pl: calc(var(--u) * 8);
  --pr: calc(var(--u) * 8);
}
.pg.sp-l { --pl: calc(var(--u) * 10.5); }
.pg.sp-r { --pr: calc(var(--u) * 10.5); }
.pg > .art { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.pg-in {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  padding: calc(var(--u) * 8) var(--pr) calc(var(--u) * 10) var(--pl);
}
.pg::before, .pg::after {
  content: "";
  position: absolute;
  z-index: 7;
  pointer-events: none;
}
.pg::after {
  inset: 0;
  background-image: var(--grain);
  background-size: 160px 160px;
  opacity: .5;
}
.pg::before { top: 0; bottom: 0; width: 10%; }
.pg.sp-l::before { left: 0; background: linear-gradient(90deg, rgba(23, 22, 20, .24), rgba(23, 22, 20, .06) 30%, rgba(23, 22, 20, 0)); }
.pg.sp-r::before { right: 0; background: linear-gradient(270deg, rgba(23, 22, 20, .24), rgba(23, 22, 20, .06) 30%, rgba(23, 22, 20, 0)); }

.pno {
  position: absolute;
  z-index: 3;
  bottom: calc(var(--u) * 3.6);
  font-family: var(--f-type);
  font-size: max(13px, calc(var(--u) * 2.4));
  color: var(--ink);
}
.sp-l .pno { right: calc(var(--u) * 6); }
.sp-r .pno { left: calc(var(--u) * 6); }

.stp-1 { top: 21%; }
.stp-2 { bottom: 21%; }
.sp-l .stp-1, .sp-l .stp-2 { left: 0; transform: translateX(-50%); }
.sp-r .stp-1, .sp-r .stp-2 { right: 0; transform: translateX(50%); }
.stp-c { display: none; }

/* The outer corner lifts under the mouse. */
.curl {
  position: absolute;
  z-index: 8;
  bottom: 0;
  width: 0;
  height: 0;
  pointer-events: none;
  transition: width .22s ease, height .22s ease;
}
.sp-l .curl {
  right: 0;
  background: linear-gradient(to top left, rgba(23, 22, 20, .3) 0 50%, #f7f5ef 50%, #d8d3c9 100%);
  box-shadow: -2px -2px 5px rgba(0, 0, 0, .18);
}
.sp-r .curl {
  left: 0;
  background: linear-gradient(to top right, rgba(23, 22, 20, .3) 0 50%, #f7f5ef 50%, #d8d3c9 100%);
  box-shadow: 2px -2px 5px rgba(0, 0, 0, .18);
}
@media (hover: hover) {
  .two .face.is-r:hover .curl, .two .face.is-l:hover .curl { width: calc(var(--u) * 6); height: calc(var(--u) * 6); }
}

/* Offcuts on the mat. */
.bits { position: absolute; inset: 0; pointer-events: none; }
.stage.single .bits { display: none; }
.bit { position: absolute; display: block; }
.bit-q { left: 4.5%; top: 12%; font-size: 70px; transform: rotate(-14deg); }
.bit-a { left: 8%; bottom: 14%; font-size: 46px; transform: rotate(19deg); }
.bit-strip {
  right: 3.5%;
  bottom: 13%;
  width: 150px;
  height: 30px;
  background: var(--cover);
  clip-path: polygon(0 12%, 22% 0, 48% 9%, 75% 0, 100% 14%, 98% 88%, 70% 100%, 36% 90%, 4% 100%);
  transform: rotate(-26deg);
  filter: drop-shadow(2px 3px 0 rgba(0, 0, 0, .25));
}
.bit-tape { left: auto; right: 5%; top: 17%; --tw: 120px; --th: 30px; --r: 68deg; transform: rotate(68deg); }
.bit-stp {
  position: absolute;
  width: 5px;
  height: 26px;
  border-radius: 1.5px;
  background: linear-gradient(90deg, #6f7378, #eef0f2 38%, #b4b8bc 62%, #66696e);
  box-shadow: 1px 2px 2px rgba(0, 0, 0, .35);
}
.bit-stp-a { right: 9%; bottom: 25%; transform: rotate(52deg); }
.bit-stp-b { right: 7.4%; bottom: 23%; transform: rotate(-12deg); }
@media (max-width: 1180px) { .bit-q, .bit-a { display: none; } }

/* A chapter added after the first run: an original page stapled in, on squared paper. */
.pg.is-insert {
  background-image:
    linear-gradient(rgba(64, 112, 178, .22) 1px, transparent 1px),
    linear-gradient(90deg, rgba(64, 112, 178, .22) 1px, transparent 1px);
  background-size: calc(var(--u) * 4.2) calc(var(--u) * 4.2);
  background-position: calc(var(--u) * 2) calc(var(--u) * 2);
}
.is-insert .stp-c { display: block; top: calc(var(--u) * 2.5); height: calc(var(--u) * 7); }
.sp-l.is-insert .stp-c { right: calc(var(--u) * 5); transform: rotate(45deg); }
.sp-r.is-insert .stp-c { left: calc(var(--u) * 5); transform: rotate(-45deg); }

.pg.blank { box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .06); }

/* Cover. */
.pg-cover .pg-in { padding-top: calc(var(--u) * 7); }
.cv-run { position: relative; margin: 0; align-self: flex-end; font-size: max(13px, calc(var(--u) * 2.5)); }
.cv-run .lbl { --r: 2.5deg; }
.cv-run .tape { left: 50%; top: 4%; --tw: 4.6em; --th: 1.3em; --r: -7deg; }
.cv-name { margin: calc(var(--u) * 3) 0 0; font-weight: 400; line-height: 1.06; }
.cv-row { display: block; }
.cv-row-1 { padding-left: 10%; }
.cv-collage {
  position: relative;
  flex: 1 1 auto;
  min-height: calc(var(--u) * 18);
  margin: calc(var(--u) * 2.5) 0 calc(var(--u) * 2);
  container-type: size;
}
.cv-ph {
  position: absolute;
  margin: 0;
  width: 36%;
  width: min(42cqw, 60cqh);
  aspect-ratio: 4 / 5;
  background: var(--white);
  transform: rotate(var(--r, 0deg));
  box-shadow: calc(var(--u) * .4) calc(var(--u) * .6) 0 rgba(23, 22, 20, .28);
}
.cv-ph .ph-box { inset: 5%; }
.cv-ph .tape { left: 50%; top: 0; --tw: 46%; --th: 13%; --r: -5deg; }
.cv-ph-0 { left: 0; top: 4%; --r: -5deg; }
.cv-ph-1 { left: 29%; top: 22%; --r: 4deg; }
.cv-ph-2 { left: 57%; top: 1%; --r: -2.5deg; }
.cv-ph-1 .tape { --r: 8deg; }
.cv-foot { margin: 0; font-size: max(15px, calc(var(--u) * 2.9)); }
.cv-foot .lbl { --r: -1.8deg; }

/* Inside front cover: every chapter number, cut out. */
.in-h { margin: 0; display: flex; align-items: flex-end; flex-wrap: wrap; gap: calc(var(--u) * 3); font-weight: 400; }
.in-count { font-size: calc(var(--u) * 15); line-height: 1; }
.in-word { font-size: max(15px, calc(var(--u) * 3)); margin-bottom: calc(var(--u) * 2.5); --r: 2deg; }
.in-grid {
  list-style: none;
  margin: calc(var(--u) * 4) 0 0;
  padding: 0;
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr));
  align-content: center;
  row-gap: calc(var(--u) * 1.2);
  column-gap: calc(var(--u) * 1.5);
}
.in-a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: max(44px, calc(var(--u) * var(--ns, 10) * 1.6));
  font-size: calc(var(--u) * var(--ns, 10));
  color: inherit;
  text-decoration: none;
}
.in-a .cut { transition: transform .2s ease; display: inline-block; }
.in-a:hover .cut { transform: scale(1.08) rotate(-2deg); }

/* Contents. */
.toc-h { margin: 0 0 calc(var(--u) * 4); font-weight: 400; line-height: 1.1; }
.toc-h-more { font-size: var(--tocf); margin-bottom: calc(var(--u) * 3.5); }
.toc { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--rowgap); }
.toc-a {
  display: flex;
  align-items: center;
  gap: calc(var(--u) * 2);
  min-height: 30px;
  color: inherit;
  text-decoration: none;
  font-size: var(--tocf);
}
.toc-no {
  flex: 0 0 auto;
  width: calc(var(--u) * 9.5);
  height: calc(var(--u) * 5.6);
  display: flex;
  align-items: center;
  font-size: calc(var(--u) * 4.1);
  line-height: 1;
}
.toc-t { flex: 0 1 auto; min-width: 0; font-size: 1em; overflow-wrap: anywhere; }
.toc-dots {
  flex: 1 1 calc(var(--u) * 3);
  min-width: calc(var(--u) * 3);
  height: 0;
  border-bottom: .16em dotted rgba(23, 22, 20, .62);
}
.toc-pg { flex: 0 0 auto; min-width: 1.4em; text-align: right; font-size: 1.75em; line-height: .8; }
.toc-a:hover .toc-t { background: var(--marker); }
.toc-a:focus-visible { outline-offset: 2px; }
.pg-toc.tight .toc { gap: calc(var(--rowgap) * .5); }
.pg-toc.tight .toc-a { font-size: calc(var(--tocf) * .94); }

/* Chapter opener (left page). */
.pg-open .pg-in { justify-content: space-between; }
.op-top { display: flex; align-items: flex-start; gap: calc(var(--u) * 3); }
.op-no { font-size: calc(var(--u) * 12); line-height: 1; }
.op-kind { font-size: max(13px, calc(var(--u) * 2.6)); margin-top: calc(var(--u) * 2.4); --r: 2deg; }
.op-t { margin: calc(var(--u) * 2) 0; font-weight: 400; line-height: 1.12; }
.op-t a { color: inherit; text-decoration: none; }
.op-t a .cut-l { transition: transform .25s ease; }
.op-t a:hover .cut-l { transform: translateY(calc(var(--y, 0em) - .04em)) rotate(calc(var(--r, 0deg) * -1)); }
.op-tag {
  position: relative;
  margin: 0;
  font-size: var(--hand);
  max-width: 94%;
  padding-left: calc(var(--u) * 10);
  transform: rotate(-2.4deg);
  transform-origin: 0 50%;
}
.op-arrow { position: absolute; left: 0; top: -.55em; width: calc(var(--u) * 8.5); height: calc(var(--u) * 5.3); }

.o-c .op-top { flex-direction: row-reverse; justify-content: flex-start; }
.o-c .op-t { text-align: center; }
.o-c .op-tag { align-self: flex-end; transform: rotate(1.8deg); transform-origin: 100% 50%; }

.o-d .op-top { order: 1; }
.o-d .op-tag { order: 2; margin-top: calc(var(--u) * 3); transform: rotate(-3.5deg); }
.o-d .op-t { order: 3; margin-top: auto; margin-bottom: 0; }
.o-d .op-no { font-size: calc(var(--u) * 9); }

.pg.o-t { background-color: var(--ink); color: var(--paper); }
.pg.o-t::after { filter: invert(1); opacity: .32; }
.o-t .op-tag { color: #f7f5ee; }
.o-t .pno { color: var(--paper); }
.o-t .op-kind { --r: -2deg; }

/* Chapter body (right page). */
.pg-body .pg-in { padding-bottom: calc(var(--u) * 17); gap: calc(var(--u) * 3.4); }
.bd-fig {
  position: relative;
  flex: 1 1 auto;
  min-height: calc(var(--u) * 26);
  max-height: 66%;
  margin: 0;
  background: var(--white);
  transform: rotate(var(--r, 0deg));
  box-shadow: calc(var(--u) * .4) calc(var(--u) * .6) 0 rgba(23, 22, 20, .2);
}
.bd-fig .ph-box { inset: calc(var(--u) * 1.8); }
.bd-fig .tape-a { left: 6%; top: 3%; --r: -32deg; --tw: calc(var(--u) * 15); --th: calc(var(--u) * 4.2); }
.bd-fig .tape-b { left: 94%; top: 97%; --r: -32deg; --tw: calc(var(--u) * 15); --th: calc(var(--u) * 4.2); }
.pg-body.tight .bd-fig { min-height: calc(var(--u) * 18); }
.pg-body.tight .pg-in { gap: calc(var(--u) * 2.2); }

.bd-stk {
  list-style: none;
  margin: 0;
  padding: calc(var(--u) * 2) 0;
  flex: 1 1 auto;
  display: flex;
  flex-wrap: wrap;
  align-content: center;
  justify-content: center;
  gap: calc(var(--u) * 3) calc(var(--u) * 2.5);
}
.bd-stk li {
  font-family: var(--f-hand);
  font-size: max(24px, calc(var(--u) * 5.4));
  line-height: 1;
  color: var(--ink);
  background: var(--white);
  padding: .3em .55em .14em;
  border: 2px solid var(--ink);
  border-radius: .3em;
  transform: rotate(var(--r, 0deg));
  box-shadow: calc(var(--u) * .4) calc(var(--u) * .5) 0 rgba(23, 22, 20, .22);
}
.bd-void { flex: 1 1 auto; min-height: calc(var(--u) * 16); }

.bd-lede { margin: 0; font-family: var(--f-read); font-size: var(--body); line-height: 1.42; }
.bd-lede .hl {
  background: linear-gradient(rgba(243, 238, 69, 0) 50%, rgba(243, 238, 69, .9) 50%, rgba(243, 238, 69, .9) 92%, rgba(243, 238, 69, 0) 92%);
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}
.bd-in-h { margin: 0 0 calc(var(--u) * 1.6); font-size: max(13px, calc(var(--u) * 2.2)); letter-spacing: .1em; text-transform: uppercase; }
.bd-heads { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; align-items: flex-start; gap: calc(var(--u) * 1.4); }
.bd-heads li { font-size: max(14px, calc(var(--u) * 2.7)); }
.bd-heads li:nth-child(2n) { margin-left: calc(var(--u) * 3); }

.bd-go {
  position: absolute;
  z-index: 4;
  right: calc(var(--u) * 7);
  bottom: calc(var(--u) * 7.5);
  font-family: var(--f-type);
  font-size: max(16px, calc(var(--u) * 3.3));
  text-decoration: none;
  color: var(--paper);
  transform: rotate(-2deg);
}
.bd-go-s {
  display: inline-block;
  padding: .52em .95em .44em;
  background: var(--ink);
  clip-path: polygon(1.5% 7%, 99% 0, 100% 91%, 0 100%);
  transition: background-color .2s ease;
}
.bd-go:hover .bd-go-s { background: var(--biro); }
.bd-go-arrow { display: inline-block; margin-left: .5em; }

/* Space at the back for the next chapter. */
.stub-slot { position: relative; flex: 1 1 auto; margin: calc(var(--u) * 5) 0 calc(var(--u) * 2); border: 2px dashed rgba(23, 22, 20, .42); }
.stub-sc { position: absolute; top: -11px; left: 14%; width: 34px; height: 20px; padding: 0 4px; color: rgba(23, 22, 20, .72); background: var(--paper); }
.stub-no { position: absolute; right: 9%; bottom: 7%; font-size: calc(var(--u) * 15); color: rgba(64, 62, 58, .5); transform: rotate(-7deg); }
.stub-slot .tape { --tw: calc(var(--u) * 13); --th: calc(var(--u) * 3.8); }
.stub-slot .tape-a { left: 0; top: 0; --r: -38deg; }
.stub-slot .tape-b { left: 100%; top: 0; --r: 36deg; }
.stub-stp { position: absolute; z-index: 3; width: max(5px, calc(var(--u) * 1)); height: calc(var(--u) * 7); border-radius: 1.5px; background: linear-gradient(90deg, #6f7378, #eef0f2 38%, #b4b8bc 62%, #66696e); box-shadow: 1px 1.5px 1.5px rgba(0, 0, 0, .3); }
.stub-stp-a { left: 30%; top: 40%; transform: rotate(68deg); }
.stub-stp-b { left: 58%; top: 52%; transform: rotate(-21deg); }

/* Inside back cover and back cover. */
.pg-colo .pg-in { justify-content: center; align-items: flex-start; gap: calc(var(--u) * 5); }
.co-name { margin: 0; font-size: calc(var(--u) * 9); line-height: 1.16; font-weight: 400; }
.co-line { margin: 0; font-size: max(15px, calc(var(--u) * 2.9)); }
.co-nav { display: flex; flex-wrap: wrap; gap: calc(var(--u) * 3); margin: 0; }
.co-btn {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  cursor: pointer;
  min-height: 44px;
  font-size: max(16px, calc(var(--u) * 3));
}
.co-btn:hover { background: var(--marker); }
.co-btn + .co-btn { --r: 1.6deg; }

.pg-back .pg-in { justify-content: flex-end; align-items: flex-start; gap: calc(var(--u) * 2.4); }
.bc-name { font-size: max(15px, calc(var(--u) * 3.2)); }
.bc-count { font-size: max(13px, calc(var(--u) * 2.4)); --r: 1.5deg; }

/* Phone. */
@media (max-width: 560px) {
  .bar { gap: 8px; padding-left: 12px; padding-right: 12px; min-height: 54px; }
  .where { min-width: 0; font-size: 13px; }
  .ctl { padding: 0 13px; }
  .brand { font-size: 15px; }
}

@media (max-height: 520px) {
  .bar { min-height: 46px; padding-top: 4px; padding-bottom: 4px; }
  .ctl { min-height: 40px; }
}

@media (prefers-reduced-motion: reduce) {
  .book, .book-sh { transition: none; }
  .op-t a .cut-l, .in-a .cut, .ctl { transition: none; }
}
