/* ───────────────────────────────────────────────────────────────────────
   Pages.

   Each page is the designer's artwork with a hidden layer of its own words
   over it. The page box is a container query container so the few pieces of
   chrome that sit on a page — the spec button, the back board — scale with it
   rather than needing breakpoints.
   ─────────────────────────────────────────────────────────────────────── */

.pg {
  position: absolute; inset: 0;
  container-type: size;
  /* .flipmount zeroes its line-height so page-flip's own markup cannot pick up
     stray inline whitespace. That inherits all the way down here, and on the
     generated pages it stacked every line on one baseline — the back cover's
     name and role were printed over each other. The page restores it. */
  line-height: 1.3;
  overflow: hidden;
  background: #fff;
  user-select: none;
}
.pg__text { user-select: text; }    /* the words stay selectable */
.pg--image { background: #f6f2ec; }
.pg--image > img { width: 100%; height: 100%; object-fit: cover; }

/* The page's own words, carried invisibly over the artwork so a screen reader,
   find-in-page and text selection all reach real text. Not `display: none` —
   that would hide it from assistive technology too. */
.pg__text {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ── inside back board ────────────────────────────────────────────── */
.pg--backcover {
  background: radial-gradient(120% 100% at 70% 80%, #e5cfd0 0%, #d8bec0 60%, #c9adaf 100%);
  /* align-content, not just place-items: auto rows stretch by default, which
     split the mark and the signature into two halves of the board instead of
     setting them together in the middle of it */
  display: grid; place-items: center; align-content: center;
}
.pg--backcover::before {
  content: ""; position: absolute; inset: 0;
  background-image: var(--paper-noise); background-size: 44% auto;
  opacity: .5; mix-blend-mode: multiply;
}
.pg--backcover .cover__star {
  /* the width/height attributes are there for the intrinsic ratio; without
     height:auto the img kept its 575px attribute height and stretched */
  position: static; width: 22%; height: auto; opacity: .5; margin-bottom: 4%;
}
.bc__sign { text-align: center; }
.bc__name { margin: 0; font-size: 4.2cqw; color: #4a3c3d; letter-spacing: .02em; }
.bc__role { margin: .6cqw 0 0; font-size: 2.6cqw; color: #7d6a6b; letter-spacing: .16em; text-transform: uppercase; }

/* ── the spec / story button that sits on a kept image ────────────── */
.pg__panelbtn {
  position: absolute; right: 2.4%; z-index: 5;
  /* Open, the magazine fills the window and the chrome floats over the foot of
     every page — including the scrubber, which is wide enough to cover this
     button on a left-hand page. It clears the bar rather than hiding under it. */
  bottom: max(2.4%, calc(var(--chrome-h) + .9rem));
  display: inline-flex; align-items: center; gap: .9cqw;
  padding: 1.1cqw 2cqw;
  border: .1cqw solid rgba(20,18,17,.28); border-radius: 40cqw;
  background: rgba(253,251,249,.9);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  font-size: 2.1cqw; letter-spacing: .04em; color: #2a2624;
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}
.pg__panelbtn:hover { background: #fff; border-color: rgba(20,18,17,.55); transform: translateY(-.3cqw); }
.pg--riot .pg__panelbtn { right: auto; left: 2.4%; }
.pg--spec .pg__panelbtn { bottom: max(1.6%, calc(var(--chrome-h) + .7rem)); }

/* ── the sheet the button opens ───────────────────────────────────── */
.specsheet { position: fixed; inset: 0; z-index: 130; }
.specsheet[hidden] { display: none; }
.specsheet__scrim {
  position: absolute; inset: 0; background: rgba(38,30,27,.42);
  backdrop-filter: blur(2px);
  opacity: 0; transition: opacity 300ms ease;
}
.specsheet.is-open .specsheet__scrim { opacity: 1; }
.specsheet__panel {
  position: absolute; top: 0; bottom: 0; right: 0;
  width: min(30rem, 92vw);
  background: var(--card);
  box-shadow: 0 0 60px -10px rgba(38,30,27,.5);
  display: flex; flex-direction: column;
  translate: 100% 0;
  transition: translate 380ms cubic-bezier(.3,.8,.3,1);
}
.specsheet.is-open .specsheet__panel { translate: 0 0; }
.specsheet__head {
  display: flex; justify-content: flex-end;
  padding: .8rem 1rem 0;
}
.specsheet__body {
  overflow-y: auto; overscroll-behavior: contain;
  padding: .4rem 1.6rem 3rem;
}

.sh__kicker {
  margin: 0 0 .5rem; font-size: .68rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-faint);
}
.sh__title { margin: 0; font-size: 1.7rem; line-height: 1.12; font-weight: 600; letter-spacing: -.01em; }
.sh__title--punk { font-family: var(--font-punk); font-weight: 400; font-size: 2.5rem; letter-spacing: .01em; color: #8c2f3f; }
.sh__style { margin: .25rem 0 1.2rem; font-size: .8rem; letter-spacing: .1em; color: var(--ink-faint); text-transform: uppercase; }
.sh__desc { margin: 0 0 1.1rem; color: var(--ink-soft); font-size: .93rem; line-height: 1.62; }
.sh__desc em { font-style: normal; color: #a8566a; }

.specsheet__body h3 {
  margin: 1.6rem 0 .55rem; font-size: .74rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink); border-bottom: 1px solid var(--line-soft); padding-bottom: .35rem;
  display: flex; justify-content: space-between; align-items: baseline;
}
.specsheet__body h3 span { letter-spacing: .06em; text-transform: none; color: var(--ink-faint); font-size: .7rem; }

.sh__fabs { margin: 0; }
.sh__fab { display: grid; grid-template-columns: 8.5rem 1fr; gap: .5rem; padding: .35rem 0; border-bottom: 1px dotted var(--line-soft); }
.sh__fab dt { font-size: .74rem; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-faint); padding-top: .1rem; }
.sh__fab dd { margin: 0; font-size: .88rem; color: var(--ink); }
.sh__fab dd em { display: block; font-style: normal; font-size: .78rem; color: var(--ink-faint); }

.sh__list, .sh__keys { margin: 0; padding-left: 1.1rem; font-size: .88rem; color: var(--ink-soft); }
.sh__list li, .sh__keys li { margin: .18rem 0; line-height: 1.45; }
.sh__keys { padding-left: 1.4rem; }

.sh__chips { list-style: none; margin: .7rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .5rem .9rem; }
.sh__chips li { display: flex; align-items: center; gap: .4rem; font-size: .76rem; color: var(--ink-soft); }
.sh__chips span { width: 1.15rem; height: 1.15rem; border-radius: 2px; background: var(--chip); box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }

.sh__table { width: 100%; border-collapse: collapse; font-size: .85rem; margin-top: .2rem; }
.sh__table thead th {
  text-align: left; font-size: .68rem; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-faint); font-weight: 500; padding: .3rem 0; border-bottom: 1px solid var(--line);
}
.sh__table thead th:last-child, .sh__table td { text-align: right; }
.sh__table tbody th { text-align: left; font-weight: 400; color: var(--ink-soft); }
.sh__table tbody th, .sh__table td { padding: .34rem 0; border-bottom: 1px dotted var(--line-soft); }
.sh__table td { font-variant-numeric: tabular-nums; color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  .specsheet__panel, .specsheet__scrim { transition: none; }
  .about__polaroid, .pg__panelbtn { transition: none; }
}


/* ── a page whose artwork never arrived ───────────────────────────── */
.pg--failed::after {
  content: attr(data-fallback);
  position: absolute; inset: 0; z-index: 2;
  display: grid; place-items: center;
  padding: 14cqw 12cqw;
  background: linear-gradient(160deg, #efe8e4, #e4dad6);
  color: #6d5c58;
  font-family: var(--font-slab);
  font-size: 3.2cqw; line-height: 1.6; text-align: center;
  text-wrap: balance;
}
