/* ==========================================================================
   Mayara's Library
   A card catalog crossed with a reading journal.
   All texture is CSS + inline SVG — there are no image assets to lose.
   ========================================================================== */

:root {
  /* Paper, ink, and the four colours of the brief */
  --paper: #fbf4e9;
  --paper-2: #f3e7d3;
  --paper-3: #fffdf8;
  --ink: #1b1512;
  --ink-soft: #5c4f47;
  --blush: #ffd9e4;
  --blush-deep: #ffc2d2;
  --hot: #f0568e;
  --hot-deep: #c93a6e;
  --butter: #ffe066;
  --butter-soft: #fff3b8;

  --serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --sans: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --mono: 'Space Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --hand: 'Caveat', 'Bradley Hand', cursive;

  --measure: 1180px;
  --gutter: clamp(1.25rem, 5vw, 4rem);
  --radius: 4px;

  /* Torn edges. One shape, recoloured wherever it is used. */
  --tear-shape: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 24' preserveAspectRatio='none'%3E%3Cpath d='M0,24 L1200,24 L1200,10 L1160,14 L1120,6 L1080,12 L1040,4 L1000,13 L960,7 L920,15 L880,5 L840,11 L800,3 L760,12 L720,6 L680,14 L640,8 L600,2 L560,11 L520,5 L480,13 L440,7 L400,14 L360,4 L320,12 L280,6 L240,13 L200,5 L160,11 L120,3 L80,12 L40,6 L0,13 Z' fill='%23000'/%3E%3C/svg%3E");
}

/* --------------------------------------------------------------------------
   Reset
   -------------------------------------------------------------------------- */

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: clamp(0.95rem, 0.9rem + 0.2vw, 1.02rem);
  line-height: 1.65;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, p, dl, dd, figure, blockquote { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; }

a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 2.5px solid var(--hot);
  outline-offset: 3px;
  border-radius: 2px;
}

/* Paper grain, sitting over everything and catching no clicks */
.grain {
  position: fixed;
  inset: 0;
  z-index: 999;
  pointer-events: none;
  opacity: 0.4;
  mix-blend-mode: multiply;
  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='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='0.42'/%3E%3C/svg%3E");
}

/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */

.wrap {
  width: 100%;
  max-width: var(--measure);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.wrap--wide { max-width: 1320px; }
.wrap--narrow { max-width: 760px; }

.section { padding-block: clamp(3.5rem, 8vw, 6.5rem) clamp(3.5rem, 8vw, 6rem); }

.section--paper { background: var(--paper); }
.section--kraft { background: var(--paper-2); }
.section--blush { background: var(--blush); }
.section--butter { background: var(--butter-soft); }

.section--grid {
  background-image:
    linear-gradient(rgba(27, 21, 18, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(27, 21, 18, 0.055) 1px, transparent 1px);
  background-size: 28px 28px;
}

/* The torn edge each section makes as it overlaps the one above it */
.tear {
  position: relative;
  z-index: 2;
  height: 24px;
  margin-top: -24px;
  background: var(--tear, var(--paper));
  -webkit-mask-image: var(--tear-shape);
  mask-image: var(--tear-shape);
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}

/* A bare section title carries no spacing of its own — .section__head does that
   job elsewhere. These are the blocks that follow one directly, and they need
   clearance for tape and torn edges that reach above their top edge. */
.section__title + .reading,
.section__title + .strips,
.section__title + .queue {
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
}

.section__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem 2rem;
  flex-wrap: wrap;
  margin-bottom: clamp(2rem, 4vw, 3rem);
}

/* --------------------------------------------------------------------------
   Type primitives
   -------------------------------------------------------------------------- */

.eyebrow,
.label {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--hot-deep);
  margin: 0 0 1rem;
}

.label { color: var(--ink-soft); margin-bottom: 0.75rem; }

.section__title,
.page-title {
  font-family: var(--serif);
  font-weight: 300;
  line-height: 0.98;
  letter-spacing: -0.015em;
  margin: 0;
}

.section__title { font-size: clamp(2.1rem, 4.4vw, 3.4rem); }
.page-title { font-size: clamp(2.8rem, 8vw, 5.4rem); }

.section__title em,
.page-title em {
  font-style: italic;
  color: var(--hot);
}

.page-lede {
  margin-top: 1.25rem;
  max-width: 46ch;
  color: var(--ink-soft);
  font-size: 1.02rem;
}

.scribble {
  font-family: var(--hand);
  font-size: 1.5rem;
  line-height: 1.2;
  color: var(--hot);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0;
}

.prose p {
  margin-bottom: 1.15em;
  max-width: 62ch;
  color: var(--ink-soft);
}

.prose p:last-child { margin-bottom: 0; }
.prose--lg p { font-size: 1.1rem; color: var(--ink); }

.doodle {
  width: 52px;
  height: auto;
  color: var(--hot);
  flex: none;
}

.doodle--arrow { width: 58px; transform: translateY(6px); }

.doodle--sparkle {
  position: absolute;
  width: 40px;
  bottom: 12px;
  left: 4px;
  color: var(--hot);
  transform: rotate(-8deg);
}

/* --------------------------------------------------------------------------
   Pills and chips
   -------------------------------------------------------------------------- */

.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 1.4rem;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: transparent;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: transform 0.25s ease, background-color 0.25s ease, color 0.25s ease;
  white-space: nowrap;
}

.pill:hover { transform: translateY(-2px); background: var(--ink); color: var(--paper); }

.pill--solid { background: var(--hot); border-color: var(--hot); color: var(--paper-3); }
.pill--solid:hover { background: var(--ink); border-color: var(--ink); }

.pill--ink { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.pill--ink:hover { background: var(--hot); border-color: var(--hot); }

.chip {
  padding: 0.55rem 1.05rem;
  border: 1.5px solid rgba(27, 21, 18, 0.28);
  border-radius: 999px;
  background: var(--paper-3);
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
  display: inline-flex;
  align-items: baseline;
  gap: 0.45rem;
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.chip:hover { border-color: var(--ink); }
.chip.is-on { background: var(--ink); border-color: var(--ink); color: var(--paper); }

.chip__count { font-size: 0.58rem; opacity: 0.55; }

/* --------------------------------------------------------------------------
   Ticker + masthead
   -------------------------------------------------------------------------- */

.ticker {
  background: var(--ink);
  color: var(--paper);
  overflow: hidden;
  padding-block: 0.55rem;
  position: relative;
  z-index: 5;
}

.ticker__track {
  display: flex;
  align-items: center;
  gap: 1.6rem;
  width: max-content;
  animation: slide 46s linear infinite;
}

.ticker__item {
  font-family: var(--mono);
  font-size: 0.63rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  white-space: nowrap;
}

.ticker__star { color: var(--hot); font-size: 0.7rem; }

@keyframes slide {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

.masthead {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.1rem var(--gutter);
  background: rgba(251, 244, 233, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(27, 21, 18, 0.1);
}

.wordmark {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  line-height: 1;
}

.wordmark__name {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: 1.5rem;
}

.wordmark__word {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  padding-bottom: 0.15rem;
}

.nav { display: flex; gap: 0.4rem; flex-wrap: wrap; }

.nav__link {
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.nav__link:hover { background: var(--blush); }
.nav__link.is-current { background: var(--hot); color: var(--paper-3); }

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.hero {
  padding: clamp(3rem, 7vw, 5.5rem) var(--gutter) clamp(3.5rem, 7vw, 5rem);
  max-width: var(--measure);
  margin-inline: auto;
}

.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 0.75fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}

.hero__title {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(3.6rem, 13vw, 9.5rem);
  line-height: 0.82;
  letter-spacing: -0.03em;
  margin: 0 0 1.6rem;
}

.hero__line { display: block; }

.hero__line--em {
  font-style: italic;
  color: var(--hot);
  padding-left: 0.12em;
}

.hero__lede {
  font-size: clamp(1.02rem, 1.4vw, 1.2rem);
  max-width: 38ch;
  color: var(--ink-soft);
}

.scribble--hero { margin-top: 1.1rem; }

.hero__actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 2rem;
}

.hero__object { position: relative; display: flex; justify-content: center; }

/* Tally of the collection */
.tally {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin-top: clamp(3rem, 6vw, 4.5rem);
  background: rgba(27, 21, 18, 0.14);
  border: 1px solid rgba(27, 21, 18, 0.14);
  border-radius: var(--radius);
  overflow: hidden;
}

.tally__cell {
  background: var(--paper);
  padding: 1.35rem 1.25rem 1.15rem;
}

.tally__label {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.tally__figure {
  font-family: var(--serif);
  font-size: clamp(2rem, 4vw, 2.9rem);
  font-weight: 300;
  line-height: 1.05;
  margin-top: 0.35rem;
}

.tally__unit { color: var(--hot); font-size: 0.5em; margin-left: 0.15em; }

/* --------------------------------------------------------------------------
   Covers — typeset when there is no photograph
   -------------------------------------------------------------------------- */

.cover {
  display: block;
  width: 100%;
  aspect-ratio: 2 / 3;
  position: relative;
  overflow: hidden;
  border-radius: 1px;
}

.cover--photo { object-fit: cover; }

.cover--drawn {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12% 11%;
  background: var(--cover-bg);
  color: var(--cover-fg);
}

.cover__spine {
  position: absolute;
  inset-block: 0;
  left: 0;
  width: 7%;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.22), rgba(0, 0, 0, 0));
}

.cover__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.5rem;
  width: 100%;
}

.cover__motif { font-size: 1.1rem; opacity: 0.8; line-height: 1; }

.cover__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(0.95rem, 2.1vw, 1.45rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
  text-wrap: balance;
}

.cover__rule { width: 22%; height: 1px; background: currentColor; opacity: 0.5; }

.cover__author {
  font-family: var(--mono);
  font-size: 0.53rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  opacity: 0.85;
}

.cover--c1 { --cover-bg: var(--ink); --cover-fg: var(--blush); }
.cover--c2 { --cover-bg: var(--blush); --cover-fg: var(--ink); }
.cover--c3 { --cover-bg: var(--hot); --cover-fg: var(--paper-3); }
.cover--c4 { --cover-bg: var(--butter); --cover-fg: var(--ink); }
.cover--c5 { --cover-bg: var(--paper-2); --cover-fg: var(--hot-deep); }
.cover--c6 { --cover-bg: var(--paper-3); --cover-fg: var(--ink); }

/* --------------------------------------------------------------------------
   Polaroids and washi tape
   -------------------------------------------------------------------------- */

.polaroid {
  position: relative;
  display: block;
  background: var(--paper-3);
  padding: 0.85rem 0.85rem 1.5rem;
  box-shadow: 0 12px 30px rgba(27, 21, 18, 0.14), 0 2px 6px rgba(27, 21, 18, 0.08);
  transform: rotate(var(--rot, var(--tilt, -2deg))) translateY(var(--lift, 0));
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.3, 1), box-shadow 0.4s ease;
}

.polaroid--hero { --tilt: -2.6deg; width: min(300px, 78vw); }
.polaroid--reading { --tilt: -3deg; width: min(250px, 60vw); flex: none; }
.polaroid--book { --tilt: -2deg; width: 100%; max-width: 330px; }

a.polaroid:hover { --rot: 0deg; --lift: -8px; box-shadow: 0 22px 46px rgba(27, 21, 18, 0.2); }

.polaroid__tape {
  position: absolute;
  z-index: 3;
  width: 104px;
  height: 28px;
  top: -14px;
  background:
    repeating-linear-gradient(90deg, rgba(255, 255, 255, 0.35) 0 3px, transparent 3px 7px),
    var(--butter);
  opacity: 0.82;
  box-shadow: 0 1px 3px rgba(27, 21, 18, 0.14);
}

.polaroid__tape--left { left: -22px; transform: rotate(-28deg); }
.polaroid__tape--right { right: -22px; top: auto; bottom: -12px; transform: rotate(-24deg); background: var(--blush-deep); }

.polaroid__photo { display: block; position: relative; }

.polaroid__caption {
  display: block;
  text-align: center;
  padding-top: 0.75rem;
}

.polaroid__hand {
  display: block;
  font-family: var(--hand);
  font-size: 1.25rem;
  color: var(--hot-deep);
  line-height: 1.1;
}

.polaroid__title {
  display: block;
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 0.3rem;
}

/* --------------------------------------------------------------------------
   Ratings and stamps
   -------------------------------------------------------------------------- */

.rating {
  display: inline-flex;
  gap: 0.08em;
  font-size: 0.82rem;
  line-height: 1;
  color: var(--hot);
}

.rating__mark--empty { color: rgba(27, 21, 18, 0.22); }

.rating__mark--half {
  position: relative;
  color: rgba(27, 21, 18, 0.22);
}

.rating__mark--half > span {
  position: absolute;
  inset: 0;
  width: 50%;
  overflow: hidden;
  color: var(--hot);
}

.stamp {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--hot-deep);
  border: 2px solid currentColor;
  box-shadow: inset 0 0 0 1px rgba(201, 58, 110, 0.25);
  border-radius: 3px;
  padding: 0.5rem 0.85rem;
  transform: rotate(-4.5deg);
  opacity: 0.9;
}

.stamp--loved { color: var(--hot); }
.stamp--open { color: var(--ink-soft); }

/* --------------------------------------------------------------------------
   The shelf grid
   -------------------------------------------------------------------------- */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(196px, 1fr));
  gap: clamp(1.75rem, 3.5vw, 2.9rem) clamp(1.25rem, 2.5vw, 2rem);
}

.grid__cell { display: block; }
.grid__cell[hidden] { display: none; }

.card {
  position: relative;
  display: block;
  background: var(--paper-3);
  padding: 0.7rem 0.7rem 0.9rem;
  box-shadow: 0 8px 22px rgba(27, 21, 18, 0.1);
  transform: rotate(var(--rot, var(--tilt, 0deg))) translateY(var(--lift, 0));
  transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.3, 1), box-shadow 0.4s ease, opacity 0.5s ease;
}

.card:hover { --rot: 0deg; --lift: -8px; box-shadow: 0 20px 40px rgba(27, 21, 18, 0.18); }

.card__tape {
  position: absolute;
  top: -11px;
  left: 50%;
  width: 68px;
  height: 22px;
  margin-left: -34px;
  background: var(--blush-deep);
  opacity: 0.85;
  transform: rotate(-3deg);
  z-index: 2;
}

/* Fixed per card, so filtering never reshuffles the colours */
.card__tape--b { background: var(--butter); transform: rotate(2.5deg); }
.card__tape--c { width: 54px; margin-left: -27px; background: var(--blush); transform: rotate(-5deg); }

.card__photo { display: block; position: relative; }

.card__flag {
  position: absolute;
  bottom: 0.5rem;
  left: 0.5rem;
  background: var(--hot);
  color: var(--paper-3);
  font-family: var(--mono);
  font-size: 0.54rem;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  padding: 0.3rem 0.5rem;
}

.card__caption { display: block; padding-top: 0.75rem; }

.card__title {
  display: block;
  font-family: var(--serif);
  font-size: 1.22rem;
  font-weight: 400;
  line-height: 1.12;
  text-wrap: balance;
}

.card__author {
  display: block;
  font-size: 0.78rem;
  color: var(--ink-soft);
  margin-top: 0.2rem;
}

.card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-top: 0.6rem;
  padding-top: 0.55rem;
  border-top: 1px solid rgba(27, 21, 18, 0.12);
}

.card__call {
  font-family: var(--mono);
  font-size: 0.53rem;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  white-space: nowrap;
}

/* --------------------------------------------------------------------------
   Currently reading
   -------------------------------------------------------------------------- */

.reading {
  display: flex;
  align-items: center;
  gap: clamp(2rem, 5vw, 4rem);
  flex-wrap: wrap;
}

.reading__copy { flex: 1 1 300px; }

.reading__call {
  font-family: var(--mono);
  font-size: 0.63rem;
  letter-spacing: 0.16em;
  color: var(--hot-deep);
}

.reading__title {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2rem, 4.5vw, 3.1rem);
  line-height: 1.02;
  margin-top: 0.5rem;
}

.reading__author { color: var(--ink-soft); margin-top: 0.35rem; }

.reading__mood {
  font-family: var(--hand);
  font-size: 1.5rem;
  color: var(--hot-deep);
  margin-top: 0.6rem;
}

.progress { margin: 1.6rem 0 1.8rem; max-width: 420px; }

.progress__meta {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}

.progress__track {
  position: relative;
  height: 9px;
  background: rgba(27, 21, 18, 0.14);
  border-radius: 999px;
}

.progress__fill {
  height: 100%;
  background: var(--ink);
  border-radius: 999px;
}

.progress__ribbon {
  position: absolute;
  top: -8px;
  width: 12px;
  height: 26px;
  margin-left: -6px;
  background: var(--hot);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 74%, 0 100%);
}

/* --------------------------------------------------------------------------
   Quote strips — torn from a notebook
   -------------------------------------------------------------------------- */

.strips { columns: 2; column-gap: clamp(1.25rem, 2.5vw, 2rem); }
.strips--wall { columns: 3; }

.strip {
  break-inside: avoid;
  display: inline-block;
  width: 100%;
  margin-bottom: clamp(1.25rem, 2.5vw, 2rem);
  padding: 1.5rem 1.5rem 2.25rem;
  background: var(--strip-bg, var(--paper-3));
  transform: rotate(var(--tilt, 0deg));
  filter: drop-shadow(0 6px 14px rgba(27, 21, 18, 0.12));
  clip-path: polygon(
    0 0, 100% 0,
    100% calc(100% - 12px), 93% 100%, 86% calc(100% - 7px), 79% calc(100% - 2px),
    72% calc(100% - 11px), 65% calc(100% - 4px), 58% calc(100% - 13px), 51% calc(100% - 6px),
    44% calc(100% - 1px), 37% calc(100% - 10px), 30% calc(100% - 3px), 23% calc(100% - 12px),
    16% calc(100% - 5px), 9% calc(100% - 9px), 0 calc(100% - 4px)
  );
}

.strip--1 { --strip-bg: var(--paper-3); --highlight: var(--butter); }
.strip--2 { --strip-bg: var(--paper); --highlight: var(--blush-deep); }
.strip--3 { --strip-bg: var(--paper-3); --highlight: rgba(240, 86, 142, 0.34); }

.strip__text {
  font-family: var(--serif);
  font-size: clamp(1.15rem, 1.9vw, 1.5rem);
  font-weight: 400;
  line-height: 1.32;
  letter-spacing: -0.005em;
  /* Keeps the line breaks in a poem, where they are the point, while still
     wrapping long prose normally. */
  white-space: pre-line;
}

/* The highlighter swipe, surviving line breaks */
.strip__mark {
  background-image: linear-gradient(
    180deg,
    transparent 58%,
    var(--highlight) 58%,
    var(--highlight) 94%,
    transparent 94%
  );
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
  padding-inline: 0.08em;
}

.strip__note {
  font-family: var(--hand);
  font-size: 1.25rem;
  line-height: 1.25;
  color: var(--hot-deep);
  margin-top: 0.9rem;
}

.strip__source {
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 1.1rem;
  padding-top: 0.8rem;
  border-top: 1px dashed rgba(27, 21, 18, 0.22);
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.strip__book { border-bottom: 1.5px solid var(--hot); padding-bottom: 1px; }
.strip__book:hover { color: var(--hot); }
.strip__author { color: var(--ink-soft); }
.strip__page { margin-left: auto; color: var(--ink-soft); }

/* --------------------------------------------------------------------------
   Book page
   -------------------------------------------------------------------------- */

.masthead-block { padding: clamp(2.75rem, 6vw, 4.75rem) 0 clamp(3rem, 6vw, 4.5rem); }
.masthead-block--tall { padding-block: clamp(4rem, 12vw, 8rem); }

.spread { padding: clamp(2rem, 4vw, 3.25rem) 0 clamp(3.5rem, 7vw, 5.5rem); }

.backlink {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: clamp(1.75rem, 4vw, 2.75rem);
}

.backlink:hover { color: var(--hot); }

.spread__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.backlink--edit { color: var(--hot-deep); border-bottom: 1.5px solid currentColor; }

.footer__edit {
  margin-left: 1rem;
  padding-bottom: 1px;
  border-bottom: 1.5px solid var(--hot);
  color: var(--blush);
}

.footer__edit:hover { color: var(--hot); }

.spread__grid {
  display: grid;
  grid-template-columns: minmax(0, 360px) minmax(0, 1fr);
  gap: clamp(2.25rem, 6vw, 5rem);
  align-items: start;
}

.spread__left { position: sticky; top: 100px; }

.book-title {
  font-family: var(--serif);
  font-weight: 300;
  font-size: clamp(2.6rem, 6vw, 4.6rem);
  line-height: 0.95;
  letter-spacing: -0.025em;
  margin-top: 0.35rem;
}

.book-author {
  font-family: var(--serif);
  font-size: clamp(1.2rem, 2vw, 1.6rem);
  color: var(--ink-soft);
  margin-top: 0.7rem;
}

.book-author em { color: var(--hot-deep); }

.verdict {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin: 1.75rem 0;
  padding-block: 1.4rem;
  border-top: 1px solid rgba(27, 21, 18, 0.14);
  border-bottom: 1px solid rgba(27, 21, 18, 0.14);
}

.verdict .rating { font-size: 1.35rem; }

/* The card in the pocket at the back */
.datecard {
  margin-top: 2.75rem;
  max-width: 390px;
  background: var(--paper-2);
  border: 1px solid rgba(27, 21, 18, 0.28);
  border-radius: 2px;
  padding: 1rem 1.15rem 0.9rem;
  box-shadow: 0 6px 16px rgba(27, 21, 18, 0.1);
  transform: rotate(0.8deg);
}

.datecard__head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding-bottom: 0.7rem;
  border-bottom: 1.5px solid rgba(27, 21, 18, 0.3);
}

.datecard__call { color: var(--hot-deep); }

.datecard__rows { padding-top: 0.35rem; }

.datecard__row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px dashed rgba(27, 21, 18, 0.2);
  font-family: var(--mono);
  font-size: 0.68rem;
}

.datecard__row dt { color: var(--ink-soft); letter-spacing: 0.06em; }
.datecard__row dd { margin: 0; letter-spacing: 0.08em; }

.datecard__foot {
  font-family: var(--mono);
  font-size: 0.54rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-soft);
  text-align: center;
  padding-top: 0.8rem;
}

.turnpage {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}

.turnpage__side { max-width: 46%; }
.turnpage__side--next { text-align: right; margin-left: auto; }

.turnpage__title {
  display: block;
  font-family: var(--serif);
  font-size: clamp(1.4rem, 3vw, 2.1rem);
  font-weight: 300;
  line-height: 1.1;
  margin-top: 0.3rem;
}

.turnpage__side:hover .turnpage__title { color: var(--hot); font-style: italic; }

/* --------------------------------------------------------------------------
   Shelf extras
   -------------------------------------------------------------------------- */

.filters {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.filters__result {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-soft);
  min-height: 1.2em;
  margin-bottom: clamp(1.5rem, 3vw, 2.25rem);
}

/* Shown wherever the library is still empty */
.blank {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
  padding: clamp(2.5rem, 7vw, 4.5rem) 1.5rem;
  border: 1.5px dashed rgba(27, 21, 18, 0.25);
  border-radius: 6px;
}

.blank__mark { color: var(--hot); font-size: 1.4rem; line-height: 1; }

.blank__note {
  font-family: var(--serif);
  font-size: clamp(1.25rem, 2.4vw, 1.7rem);
  font-weight: 300;
  max-width: 30ch;
  color: var(--ink-soft);
}

.queue { margin-top: 1.75rem; border-top: 1px solid rgba(27, 21, 18, 0.16); }

.queue__row {
  display: grid;
  grid-template-columns: 9rem minmax(0, 1fr) minmax(0, 0.7fr) 5rem;
  gap: 1rem;
  align-items: baseline;
  padding: 1rem 0;
  border-bottom: 1px solid rgba(27, 21, 18, 0.16);
}

.queue__call,
.queue__pages {
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  color: var(--ink-soft);
}

.queue__pages { text-align: right; }

.queue__title { font-family: var(--serif); font-size: 1.4rem; }
.queue__author { color: var(--ink-soft); font-size: 0.85rem; }

/* --------------------------------------------------------------------------
   About
   -------------------------------------------------------------------------- */

.note {
  position: relative;
  background: var(--paper-3);
  padding: clamp(2rem, 5vw, 3.25rem);
  box-shadow: 0 14px 34px rgba(27, 21, 18, 0.12);
  transform: rotate(-0.7deg);
}

.note__pin {
  position: absolute;
  top: -12px;
  left: 50%;
  width: 22px;
  height: 22px;
  margin-left: -11px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #ff9dc0, var(--hot) 60%, var(--hot-deep));
  box-shadow: 0 3px 6px rgba(27, 21, 18, 0.28);
}

.note .scribble { margin-top: 1.75rem; }

.legend { margin-top: 2.75rem; }

.legend__list {
  display: grid;
  gap: 0.6rem;
  font-size: 0.92rem;
}

.legend__list li {
  display: flex;
  align-items: baseline;
  gap: 0.9rem;
  flex-wrap: wrap;
}

.legend__stars {
  color: var(--hot);
  letter-spacing: 0.1em;
  font-size: 0.85rem;
}

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

.footer {
  background: var(--ink);
  color: var(--paper);
  padding: clamp(3rem, 7vw, 5rem) var(--gutter) 2rem;
  background-image:
    repeating-linear-gradient(0deg, rgba(240, 86, 142, 0.14) 0 12px, transparent 12px 24px),
    repeating-linear-gradient(90deg, rgba(240, 86, 142, 0.14) 0 12px, transparent 12px 24px);
}

.footer__inner {
  max-width: var(--measure);
  margin-inline: auto;
  display: flex;
  justify-content: space-between;
  gap: clamp(2.5rem, 6vw, 5rem);
  flex-wrap: wrap;
}

.exlibris {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  border: 2px solid var(--hot);
  border-radius: 50%;
  width: 168px;
  height: 168px;
  justify-content: center;
  text-align: center;
  transform: rotate(-6deg);
  color: var(--blush);
}

.exlibris__top,
.exlibris__bottom {
  font-family: var(--mono);
  font-size: 0.55rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.exlibris__name {
  font-family: var(--serif);
  font-style: italic;
  font-size: 2rem;
  line-height: 1.1;
}

.exlibris__rule { width: 42px; height: 1px; background: var(--hot); margin: 0.35rem 0; }

.footer__cols { display: flex; gap: clamp(2.5rem, 6vw, 5rem); flex-wrap: wrap; }
.footer__col { display: flex; flex-direction: column; gap: 0.5rem; }
.footer__col .label { color: var(--hot); margin-bottom: 0.25rem; }
.footer__col a { font-size: 0.95rem; }
.footer__col a:hover { color: var(--hot); }
.footer__stat { font-family: var(--mono); font-size: 0.75rem; color: rgba(251, 244, 233, 0.72); }

.footer__note {
  max-width: var(--measure);
  margin: clamp(3rem, 6vw, 4.5rem) auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(251, 244, 233, 0.18);
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(251, 244, 233, 0.6);
}

.footer__doodle { color: var(--hot); font-size: 0.9rem; }

/* --------------------------------------------------------------------------
   Reveal on scroll
   -------------------------------------------------------------------------- */

.js .reveal { opacity: 0; --lift: 20px; }

.js .reveal.is-in {
  opacity: 1;
  --lift: 0px;
  transition-delay: var(--delay, 0ms);
}

.js .strip { transition: opacity 0.6s ease, transform 0.6s cubic-bezier(0.2, 0.8, 0.3, 1); }
.js .strip.reveal { transform: rotate(var(--tilt, 0deg)) translateY(20px); }
.js .strip.reveal.is-in { transform: rotate(var(--tilt, 0deg)) translateY(0); }

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1000px) {
  .strips--wall { columns: 2; }
  .spread__grid { grid-template-columns: minmax(0, 300px) minmax(0, 1fr); }
}

@media (max-width: 860px) {
  .hero__grid { grid-template-columns: minmax(0, 1fr); }
  .hero__object { justify-content: flex-start; margin-top: 1.25rem; padding-left: 18px; }
  .doodle--sparkle { left: auto; right: -10px; }
  .tally { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .spread__grid { grid-template-columns: minmax(0, 1fr); }
  .spread__left { position: static; }
  .polaroid--book { max-width: 260px; }
  .queue__row { grid-template-columns: minmax(0, 1fr) 4.5rem; }
  .queue__call { grid-column: 1 / -1; }
  .queue__author { grid-column: 1; }
}

@media (max-width: 640px) {
  .strips,
  .strips--wall { columns: 1; }
  .masthead { position: static; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .exlibris { width: 140px; height: 140px; }
  .exlibris__name { font-size: 1.6rem; }
  .turnpage__side { max-width: 100%; }
}

/* --------------------------------------------------------------------------
   Reduced motion
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .js .reveal { opacity: 1; --lift: 0px; }
  .js .strip.reveal { transform: rotate(var(--tilt, 0deg)); }
  .ticker__track { animation: none; }
}
