/* Paper & Pie — Stacks. Generated by build/build_stacks.py. */

:root {
  --cream: #F5E6D3;
  --white: #FFFFFF;
  --warm: #6B5D52;
  --dark: #4A4038;
  --ink: #000000;
  --paper: #F7EEE0;
  --foil: #C8A567;
  --rule: rgba(74, 64, 56, .22);
  --measure: 34rem;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 300 1.0625rem/1.66 Spectral, Georgia, "Times New Roman", serif;
  font-variant-numeric: oldstyle-nums;
}

img { max-width: 100%; height: auto; }

a { color: inherit; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--foil);
  outline-offset: 3px;
}

.skip {
  position: fixed; left: 1rem; top: -4rem; z-index: 60;
  background: var(--dark); color: var(--paper);
  padding: .6rem 1rem; text-decoration: none;
  transition: top .18s;
}
.skip:focus { top: 1rem; }

/* ---------- the world ---------- */

#world {
  position: fixed; inset: 0; width: 100%; height: 100%;
  display: block; z-index: 0;
  opacity: 0; transition: opacity .9s ease;
}
html.world-live #world { opacity: 1; }
html.world-live body { background: #4A4038; }

.grain { display: none; }
html.world-live .grain {
  display: block; position: fixed; inset: 0; z-index: 1;
  pointer-events: none; opacity: .5;
  background:
    radial-gradient(120% 80% at 50% 45%, rgba(0,0,0,0) 42%, rgba(20,14,10,.62) 100%);
}

/* ---------- fixed interface ---------- */

.top {
  position: fixed; z-index: 20; top: 0; left: 0; right: 0;
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1.5rem; padding: 1.1rem clamp(1rem, 4vw, 2.6rem);
}
.mark { text-decoration: none; display: block; line-height: 1.2; }
.mark__name {
  display: block;
  font: 400 1.18rem/1 "Libre Caslon Display", Georgia, serif;
  letter-spacing: .02em;
}
.mark__sub {
  display: block; margin-top: .28rem;
  font-size: .68rem; letter-spacing: .17em; text-transform: uppercase;
  opacity: .62;
}
.topnav { display: flex; gap: clamp(.9rem, 2.4vw, 1.9rem); align-items: baseline; }
.topnav a {
  text-decoration: none; font-size: .78rem;
  letter-spacing: .13em; text-transform: uppercase; opacity: .74;
}
.topnav a:hover { opacity: 1; }
.topnav .is-key {
  opacity: 1; border-bottom: 1px solid var(--foil); padding-bottom: .12rem;
  font-variant-numeric: lining-nums;
}

.rail {
  position: fixed; z-index: 20; left: clamp(1rem, 4vw, 2.6rem);
  right: clamp(1rem, 4vw, 2.6rem); bottom: 1.05rem;
  display: flex; align-items: center; gap: .9rem;
  font-size: .68rem; letter-spacing: .15em; text-transform: uppercase;
}
.rail__depth { min-width: 3.4em; font-variant-numeric: lining-nums; opacity: .8; }
.rail__track {
  flex: 1; height: 1px; background: var(--rule); position: relative; overflow: hidden;
}
.rail__fill {
  position: absolute; inset: 0; background: var(--foil);
  transform: scaleX(0); transform-origin: 0 50%;
}
.rail__note { opacity: .55; }

.marks {
  position: fixed; z-index: 20; right: clamp(1rem, 4vw, 2.6rem);
  top: 50%; transform: translateY(-50%);
  display: none; flex-direction: column; gap: .55rem; text-align: right;
}
.marks a {
  text-decoration: none; font-size: .68rem; letter-spacing: .1em;
  text-transform: uppercase; opacity: .42;
  display: flex; align-items: center; justify-content: flex-end; gap: .55rem;
}
.marks a i {
  width: 14px; height: 1px; background: currentColor; display: block;
  transition: width .3s ease;
}
.marks a:hover { opacity: .8; }
.marks a.is-on { opacity: 1; }
.marks a.is-on i { width: 30px; background: var(--foil); }
@media (min-width: 62rem) { .marks { display: flex; } }

/* The chapter rail owns the right edge on wide screens; the reading block
   has to stop before it rather than run underneath. */
@media (min-width: 62rem) {
  .chapter--right .beat { margin-right: 10.5rem; }
  .chapter--centre .beat { max-width: 38rem; }
}

/* ---------- chapters ---------- */

.journey { position: relative; z-index: 10; }

.chapter {
  min-height: 100vh; min-height: 100svh;
  display: flex; align-items: center;
  padding: 7.5rem clamp(1.1rem, 4vw, 2.6rem) 6rem;
}
.chapter--centre { justify-content: center; text-align: center; }
.chapter--left { justify-content: flex-start; }
.chapter--right { justify-content: flex-end; }

.beat { max-width: var(--measure); position: relative; }
.chapter--centre .beat { max-width: 40rem; }

html.world-live .beat {
  padding: 1.9rem clamp(1.2rem, 2.6vw, 2.1rem);
  color: var(--cream);
  background: linear-gradient(180deg,
    rgba(28, 21, 16, .80) 0%, rgba(28, 21, 16, .66) 62%, rgba(28, 21, 16, .40) 100%);
  border-left: 1px solid rgba(200, 165, 103, .34);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}
html.world-live .chapter--centre .beat { border-left: 0; border-top: 1px solid rgba(200, 165, 103, .34); }
html.world-live .top,
html.world-live .rail,
html.world-live .marks { color: var(--cream); }
html.world-live .rail__track { background: rgba(245, 230, 211, .22); }

/* The aisle runs from near-black at the door to a lit arch at the end, so
   fixed chrome cannot rely on the world staying dark behind it. Local
   scrims, not a blanket over the whole scene. */
html.world-live .top {
  background: linear-gradient(180deg, rgba(24, 18, 13, .72), rgba(24, 18, 13, 0));
  padding-bottom: 2.4rem;
}
html.world-live .rail {
  text-shadow: 0 1px 6px rgba(24, 18, 13, .9);
}
html.world-live .marks a { text-shadow: 0 1px 7px rgba(24, 18, 13, .95); }
html.world-live .marks a { opacity: .58; }
html.world-live .marks a.is-on { opacity: 1; }

/* Entrance. Only under html.js, so the plain page is never hidden. */
html.js .beat > * { opacity: 0; transform: translateY(14px); }
html.js .beat.is-in > * {
  opacity: 1; transform: none;
  transition: opacity .72s cubic-bezier(.2, .7, .2, 1),
              transform .72s cubic-bezier(.2, .7, .2, 1);
}
html.js .beat.is-in > *:nth-child(2) { transition-delay: .06s; }
html.js .beat.is-in > *:nth-child(3) { transition-delay: .12s; }
html.js .beat.is-in > *:nth-child(4) { transition-delay: .18s; }
html.js .beat.is-in > *:nth-child(5) { transition-delay: .24s; }
html.js .beat.is-in > *:nth-child(6) { transition-delay: .30s; }

/* ---------- type ---------- */

.eyebrow {
  margin: 0 0 1.1rem;
  font-size: .68rem; letter-spacing: .19em; text-transform: uppercase;
  opacity: .66; font-variant-numeric: lining-nums;
}
.title {
  margin: 0 0 .5rem;
  font: 400 clamp(2.9rem, 9vw, 5.6rem)/.96 "Libre Caslon Display", Georgia, serif;
  letter-spacing: -.012em;
}
h2 {
  margin: 0 0 .9rem;
  font: 400 clamp(1.75rem, 4vw, 2.7rem)/1.12 "Libre Caslon Display", Georgia, serif;
  letter-spacing: -.006em;
}
.lede { margin: 0 0 .8rem; font-size: 1.16rem; font-style: italic; opacity: .9; }
.sub {
  margin: 0 0 1.1rem;
  font-size: .74rem; letter-spacing: .22em; text-transform: uppercase; opacity: .7;
}
.beat p { margin: 0 0 .95rem; }
.cue {
  margin-top: 1.7rem !important;
  font-size: .68rem; letter-spacing: .19em; text-transform: uppercase; opacity: .6;
}

/* ---------- the menu, as spines ---------- */

.spines, .editions, .feats { list-style: none; margin: 0; padding: 0; }
.spines li + li { margin-top: .1rem; }

.spine {
  appearance: none; -webkit-appearance: none;
  display: block; width: 100%; text-align: left;
  background: none; border: 0; border-bottom: 1px solid var(--rule);
  color: inherit; font: inherit; cursor: pointer;
  padding: .72rem .2rem .72rem 1.15rem;
  position: relative;
  transition: background-color .25s ease, padding-left .25s ease;
}
.spine::before {
  content: ""; position: absolute; left: 0; top: .78rem; bottom: .78rem;
  width: 3px; background: var(--foil); opacity: .38;
  transition: opacity .25s ease, transform .25s ease;
}
.spine:hover, .spine.is-lit { padding-left: 1.45rem; }
.spine:hover::before, .spine.is-lit::before { opacity: 1; transform: scaleX(1.7); }
html.world-live .spine { border-bottom-color: rgba(245, 230, 211, .22); }
html.world-live .spine:hover, html.world-live .spine.is-lit {
  background: rgba(200, 165, 103, .10);
}
.spine__name {
  display: block;
  font: 400 1.12rem/1.3 "Libre Caslon Display", Georgia, serif;
}
.spine__note { display: block; margin-top: .2rem; font-size: .92rem; opacity: .72; }

.feats { margin: .4rem 0 1.2rem; }
.feats li {
  display: inline-block; margin: 0 .4rem .45rem 0;
  padding: .3rem .7rem;
  border: 1px solid var(--rule); border-radius: 999px;
  font-size: .78rem; letter-spacing: .04em;
}
html.world-live .feats li { border-color: rgba(245, 230, 211, .28); }

.editions li + li { margin-top: 1.5rem; }
.editions address { font-style: normal; margin: .5rem 0 .2rem; opacity: .84; }
.editions .hours {
  margin: 0 !important; font-size: .82rem; letter-spacing: .04em; opacity: .68;
  font-variant-numeric: lining-nums;
}
.spine--wide { border-bottom: 0; padding-bottom: .2rem; }

.call {
  display: inline-block; margin-top: .35rem;
  text-decoration: none; border-bottom: 1px solid var(--foil);
  padding-bottom: .16rem; font-variant-numeric: lining-nums;
  letter-spacing: .02em;
}
.contact {
  display: flex; gap: .9rem; align-items: baseline;
  border-bottom: 1px solid var(--rule); padding-bottom: .6rem;
}
html.world-live .contact { border-bottom-color: rgba(245, 230, 211, .2); }
.contact span {
  flex: 0 0 7.2rem;
  font-size: .68rem; letter-spacing: .17em; text-transform: uppercase; opacity: .62;
}
.contact a { text-decoration: none; border-bottom: 1px solid var(--foil); }
.colophon {
  margin-top: 1.8rem !important; font-size: .8rem; opacity: .6; line-height: 1.7;
}

/* ---------- narrow ---------- */

@media (max-width: 48rem) {
  /* A phone frame is too narrow to put the copy beside the shelf, so it goes
     underneath it instead: the reading block sits on the floor of the
     viewport and the aisle keeps the top third. Centring the card here hides
     the exact spines the chapter is about. */
  .chapter {
    align-items: flex-end;
    padding-top: 5.2rem;
    padding-bottom: 4.4rem;
  }
  .chapter--left, .chapter--right { justify-content: center; }
  .topnav a:not(.is-key) { display: none; }
  .rail__note { display: none; }

  html.world-live .beat { padding: 1.35rem 1.1rem 1.5rem; }
  .beat { width: 100%; }
  h2 { margin-bottom: .7rem; }
  .lede { font-size: 1.06rem; }
  .spine { padding-top: .56rem; padding-bottom: .56rem; }
  .spine__name { font-size: 1.04rem; }
  .spine__note { font-size: .86rem; }
  .editions li + li { margin-top: 1rem; }
  .editions address { font-size: .93rem; line-height: 1.5; margin: .35rem 0 .15rem; }
  .editions .hours { font-size: .78rem; }
  .beat > h2 { font-size: 1.62rem; }
  .beat p { margin-bottom: .75rem; }
}
