/* ==========================================================================
   LITERARY ARTS: "The Stacks"  (round 3)
   Object world: book spines on a shelf, library catalog cards, the date-due
   slip in its pocket, typewriter type, pencil marginalia, dog-eared pages,
   a violet rubber stamp, endpaper maps.
   Loads after shell.css. Adds the object world only; never restyles shared
   components (cards, .ev, chips, header, footer, search).
   Every class is prefixed l-.
   ========================================================================== */

.sec-literary {
  --l-night: #1F1B2E;      /* ink-violet night (= --sec-deep) */
  --l-night-2: #2C2742;
  --l-violet: #4B3A9E;     /* stamp-pad violet (= --sec-ink) */
  --l-tan: #E8DCBC;        /* page tan / foil on dark (= --sec-accent) */
  --l-cream: #F4EEDF;      /* paper cream (= --sec-paper) */
  --l-page: #FBF7EC;       /* a fresh page */
  --l-buff: #F4E8CB;       /* catalog-card stock */
  --l-manila: #E2CD9F;     /* book pocket */
  --l-rule: #B23A3A;       /* catalog red rule: a RULE only, never text */
  --l-umber: #6B4A2F;      /* shelf wood */
  --l-umber-d: #4A321F;
  --l-pencil: #55505E;     /* graphite marginalia: 6.4:1 on cream */
  --l-typed: #2A2533;      /* typewriter ink */
  --f-caslon: "Libre Caslon Display", "Libre Caslon Text", Georgia, serif;
  --f-caslon-text: "Libre Caslon Text", Georgia, serif;
  --f-typed: "Special Elite", "Courier Prime", "Courier New", monospace;
  --l-grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .3 0 0 0 0 .22 0 0 0 0 .1 0 0 0 .07 0'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
  --l-wood:
    repeating-linear-gradient(90deg, rgba(0,0,0,0) 0 38px, rgba(0,0,0,.07) 38px 40px, rgba(0,0,0,0) 40px 97px, rgba(255,255,255,.05) 97px 99px),
    linear-gradient(180deg, #8A6644 0 3px, #6B4A2F 3px 62%, #573B24);
}

/* heading flourish: Caslon italic for one word */
.sec-literary .block-title em,
.sec-literary .hero-title em {
  font-family: var(--f-caslon-text); font-style: italic; font-weight: 400;
  color: var(--l-violet); letter-spacing: -.01em;
}
.sec-literary .block--deep .block-title em { color: var(--l-tan); }
.sec-literary .list-cta .block-title em { color: #fff; }
.sec-literary .block-title { font-size: clamp(1.9rem, 3.4vw, 2.85rem); }

/* ==========================================================================
   [1] HERO: the reading room at night. A dog-eared title page, an open book
   under the lamp, and a shelf along the bottom.
   ========================================================================== */
.l-hero {
  position: relative; overflow: hidden; isolation: isolate;
  background:
    radial-gradient(ellipse 42% 58% at 79% 12%, rgba(232,220,188,.20), rgba(232,220,188,0) 70%),
    radial-gradient(ellipse 60% 50% at 0% 100%, rgba(75,58,158,.35), transparent 70%),
    var(--l-night);
  color: var(--l-cream);
  padding-top: clamp(32px, 4.5vw, 60px);
}
.l-hero::before {                        /* wallpaper: a faint pinstripe, like old library walls */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: repeating-linear-gradient(90deg, rgba(232,220,188,.035) 0 1px, transparent 1px 22px);
  -webkit-mask-image: linear-gradient(180deg, #000 30%, transparent 85%);
  mask-image: linear-gradient(180deg, #000 30%, transparent 85%);
}
.l-hero-grid {
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(24px, 4vw, 64px); align-items: center;
  padding-bottom: clamp(30px, 3.5vw, 48px);
}

/* the title page */
.l-page-wrap { filter: drop-shadow(0 22px 34px rgba(0,0,0,.45)); rotate: -.8deg; }
.l-page {
  position: relative; color: var(--ink);
  background: var(--l-grain), linear-gradient(170deg, var(--l-page), var(--l-cream) 70%);
  padding: clamp(28px, 3.6vw, 48px) clamp(22px, 3.6vw, 52px) clamp(18px, 2vw, 26px);
  clip-path: polygon(0 0, calc(100% - 54px) 0, 100% 54px, 100% 100%, 0 100%);
}
.l-page::before {                         /* a hairline bookplate frame */
  content: ""; position: absolute; inset: 12px; border: 1px solid rgba(75,58,158,.28); pointer-events: none;
}
.l-page::after {                          /* the dog-ear: the folded corner flap */
  content: ""; position: absolute; top: 0; right: 0; width: 54px; height: 54px;
  background: linear-gradient(225deg, transparent 0 50%, #D9CCAA 50%, #EDE3C9 78%, #E3D7B8);
  box-shadow: -3px 3px 6px rgba(31,27,46,.12);
}
.l-page .eyebrow { color: var(--l-violet); }
.l-hero .hero-title {
  font: 400 min(var(--hero-size), 4.6vw)/1.02 var(--f-caslon);
  letter-spacing: -.012em; color: var(--l-night); margin: 6px 0 18px;
}
.l-hero .hero-title span { display: block; }
.l-hero .hero-title em { color: var(--l-violet); }
.l-typed {
  font: 400 clamp(16px, 1.35vw, 18.5px)/1.55 var(--f-typed); color: var(--l-typed);
  max-width: 34em; margin-bottom: 22px;
}
.l-caret {                                 /* the blinking typewriter caret: visible in the first frame */
  display: inline-block; width: .55em; height: 1.05em; margin-left: 3px; vertical-align: -.15em;
  background: var(--l-violet); animation: l-blink 1.1s steps(1) infinite;
}
@keyframes l-blink { 50% { opacity: 0; } }
.l-hero .search { box-shadow: 0 0 0 1px rgba(31,27,46,.22), 5px 5px 0 var(--l-violet), 0 14px 30px rgba(31,27,46,.18); }
.l-hero .search-go { font: 400 18px/1 var(--f-caslon); letter-spacing: .01em; }
.l-page-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: 4px; }
.l-page-foot .search-alt { margin-top: 0; }
.l-page-foot .search-alt a { color: var(--l-violet); }

/* violet rubber stamp */
.l-stamp { width: 108px; flex: none; rotate: -14deg; margin: -14px 4px -8px 0; mix-blend-mode: multiply; opacity: .92; }
.l-stamp text { font-family: var(--font-mono); }

/* the open book under the lamp */
.l-desk { position: relative; justify-self: end; width: min(100%, 540px); }
.l-openbook { width: 100%; height: auto; rotate: -3deg; filter: drop-shadow(0 26px 30px rgba(0,0,0,.5)); }
.l-desk-tag {
  margin-top: 14px; text-align: center;
  font: 500 11px/1 var(--font-mono); letter-spacing: .24em; text-transform: uppercase; color: var(--sec-mist);
}

/* the shelf along the bottom of the hero (decorative) */
.l-hero-shelf {
  position: relative; display: flex; align-items: flex-end; gap: 2px;
  height: 150px; padding: 0 var(--gutter); overflow: hidden;
  background: linear-gradient(180deg, transparent 0 40%, rgba(0,0,0,.25));
}
.l-hero-shelf::after {                     /* the plank */
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 16px;
  background: var(--l-wood); box-shadow: 0 -2px 0 rgba(0,0,0,.25);
}
.l-hero-shelf i {
  flex: none; position: relative; bottom: 16px; width: var(--w); height: var(--h);
  border-radius: 2px 2px 0 0;
  background:
    linear-gradient(180deg, transparent 0 12px, var(--f, rgba(232,220,188,.7)) 12px 14px, transparent 14px 17px, var(--f, rgba(232,220,188,.7)) 17px 18px, transparent 18px calc(100% - 22px), var(--f, rgba(232,220,188,.6)) calc(100% - 22px) calc(100% - 20px), transparent calc(100% - 20px)),
    linear-gradient(90deg, rgba(0,0,0,.3), rgba(255,255,255,.1) 25%, rgba(0,0,0,0) 50%, rgba(0,0,0,.28)),
    var(--c);
  transform-origin: 0 100%;
}
.l-hero-shelf i.lean { rotate: var(--r, -9deg); }
.l-hero-shelf i.lbl::after {               /* library spine label */
  content: ""; position: absolute; left: 3px; right: 3px; bottom: 28px; height: 15px; border-radius: 2px; background: #F7F1E1;
}

/* ==========================================================================
   [2] KINDS: seven spines on a shelf. Each spine is a link, with a Dewey
   call-number label. Phones: the books lie flat in a stack.
   ========================================================================== */
.l-kinds { background: var(--l-cream); }
.l-shelf {
  --area: 410px;
  list-style: none; position: relative; isolation: isolate;
  display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)) minmax(0, 1.05fr);
  padding-top: 10px;
}
.l-shelf::before {                          /* the plank under every spine */
  content: ""; position: absolute; left: -26px; right: -26px; top: calc(var(--area) + 10px); height: 26px;
  background: var(--l-wood); border-radius: 2px;
  box-shadow: 0 2px 0 #3E2A19, 0 18px 26px rgba(31,27,46,.22);
}
.l-shelf::after {                           /* the back of the bookcase */
  content: ""; position: absolute; left: -26px; right: -26px; top: 0; height: calc(var(--area) + 10px); z-index: -1;
  background: linear-gradient(180deg, rgba(107,74,47,.05), rgba(107,74,47,.13));
  border-inline: 10px solid #6B4A2F;
}
.l-shelf > li { display: flex; flex-direction: column; min-width: 0; }
.l-book { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); height: 100%; }
.l-book-slot { height: var(--area); display: flex; align-items: flex-end; justify-content: center; }
.l-spine {
  position: relative; display: flex; flex-direction: column; align-items: center;
  width: var(--w, 90%); height: var(--h, 360px);
  color: var(--foil, var(--l-tan));
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,.035) 0 1px, transparent 1px 3px),
    linear-gradient(90deg, rgba(0,0,0,.34), rgba(255,255,255,.12) 16%, rgba(255,255,255,0) 38%, rgba(0,0,0,.06) 72%, rgba(0,0,0,.36)),
    var(--cloth);
  border-radius: 4px 4px 1px 1px;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.2), 3px 0 0 rgba(31,27,46,.16);
  transform-origin: 30% 100%; transition: transform .35s cubic-bezier(.2,.8,.2,1);
}
.l-spine::before, .l-spine::after {         /* gilt bands, head and tail */
  content: ""; position: absolute; left: 12%; right: 12%; height: 9px;
  border-top: 2px solid currentColor; border-bottom: 1px solid currentColor; opacity: .8;
}
.l-spine::before { top: 20px; }
.l-spine::after { bottom: 84px; }
.l-spine-title {
  writing-mode: vertical-rl; margin-top: 46px; max-height: calc(var(--h, 360px) - 150px);
  font: 400 clamp(21px, 1.85vw, 27px)/1.08 var(--f-caslon); letter-spacing: .01em; text-align: center;
}
.l-spine-orn { position: absolute; bottom: 98px; font: 400 15px/1 var(--f-caslon); opacity: .9; }
.l-callno {                                  /* the white call-number label */
  position: absolute; left: 50%; bottom: 24px; translate: -50% 0;
  min-width: 56px; padding: 6px 7px 5px; border-radius: 3px; text-align: center;
  background: #FBF8EF; color: var(--l-night);
  font: 400 13.5px/1.15 var(--f-typed); box-shadow: 0 1px 0 rgba(0,0,0,.25);
}
.l-callno small { display: block; font-size: 11px; letter-spacing: .06em; }
.l-spine-note { display: none; }
.l-book:hover .l-spine, .l-book:focus-visible .l-spine { transform: translateY(-14px) rotate(-6deg); }
.l-note {
  margin-top: 46px; padding: 0 12px 0 6px;
  font: 500 12px/1.45 var(--font-mono); color: var(--muted);
}
.l-note b { display: block; font: 700 15px/1.25 var(--font-ui); color: var(--ink); margin-bottom: 3px; }
.l-book:hover .l-note b { color: var(--l-violet); text-decoration: underline; }
/* the decorative end of the shelf: books lying flat + a bookend */
.l-shelf-end { position: relative; height: var(--area); }
.l-flat { position: absolute; right: 30px; height: 26px; border-radius: 2px 4px 4px 2px; background: linear-gradient(180deg, rgba(255,255,255,.12), rgba(0,0,0,.2)), var(--c); box-shadow: inset -6px 0 0 rgba(244,238,223,.75); }
.l-bookend { position: absolute; right: 0; bottom: 0; width: 20px; height: 150px; background: linear-gradient(90deg, #2C2742, #1F1B2E); border-radius: 3px 3px 0 0; box-shadow: -2px 0 0 rgba(255,255,255,.08) inset; }
.l-bookend::after { content: ""; position: absolute; right: 0; bottom: 0; width: 76px; height: 7px; background: #1F1B2E; border-radius: 2px; }

/* ==========================================================================
   [3] EVENTS: featured = a date-due slip in its pocket, inside a cover
   ========================================================================== */
.l-events-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(20px, 3vw, 40px); align-items: start; }
.l-due {
  position: relative; display: flex; flex-direction: column; justify-content: flex-end;
  min-height: 600px; padding: 30px 30px 34px; text-decoration: none; color: var(--ink); overflow: hidden;
  background:                                 /* the inside cover: endpaper in two violets */
    radial-gradient(circle at 20% 30%, rgba(154,134,232,.18) 0 18%, transparent 19%),
    radial-gradient(circle at 70% 10%, rgba(232,220,188,.08) 0 22%, transparent 23%),
    repeating-radial-gradient(circle at 30% 120%, #2C2742 0 7px, #26213A 7px 14px);
  border-radius: 4px; box-shadow: inset 0 0 0 10px #1F1B2E, 0 18px 36px rgba(31,27,46,.25);
  transition: transform .25s;
}
.l-due:hover { transform: translateY(-3px); }
.l-due-slip {
  position: absolute; left: 50%; top: 38px; translate: -50% 0; width: 78%;
  background: #FBF6E8; padding: 16px 18px 260px; rotate: 1.4deg;
  box-shadow: 0 2px 4px rgba(0,0,0,.25);
}
.l-due-slip-head { display: block; text-align: center; font: 700 15px/1 var(--font-ui); letter-spacing: .3em; color: var(--l-night); padding-bottom: 8px; border-bottom: 2px solid var(--l-night); }
.l-due-rows { display: grid; grid-template-columns: 1fr 1fr; }
.l-due-rows span {
  height: 34px; border-bottom: 1px solid #C9BFA8; display: flex; align-items: center; justify-content: center;
  font: 500 15px/1 var(--font-mono); letter-spacing: .12em; color: var(--l-violet); text-transform: uppercase;
}
.l-due-rows span:nth-child(odd) { border-right: 1px solid #C9BFA8; }
.l-due-rows i { font-style: normal; display: inline-block; }
.l-due-rows span:nth-child(1) i { rotate: -3deg; } .l-due-rows span:nth-child(2) i { rotate: 2deg; opacity: .85; }
.l-due-rows span:nth-child(3) i { rotate: -1deg; opacity: .9; } .l-due-rows span:nth-child(4) i { rotate: 3deg; }
.l-due-rows span:nth-child(5) i { rotate: 1deg; opacity: .8; }
.l-due-big {                                  /* the featured date, stamped hard */
  position: absolute; right: 22px; top: 238px; padding: 6px 12px; rotate: -8deg;
  border: 3px solid var(--l-violet); border-radius: 4px; color: var(--l-violet);
  font: 500 24px/1 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; mix-blend-mode: multiply;
}
.l-due-pocket {
  position: relative; z-index: 1; display: flex; flex-direction: column; gap: 5px;
  background: var(--l-grain), linear-gradient(180deg, #E8D5AA, var(--l-manila));
  padding: 34px 26px 22px; color: var(--l-night);
  -webkit-mask: radial-gradient(circle at 50% 0, transparent 24px, #000 24.5px);
  mask: radial-gradient(circle at 50% 0, transparent 24px, #000 24.5px);
  box-shadow: inset 0 0 0 1px rgba(74,50,31,.25);
}
.l-due-lib { font: 500 10.5px/1.2 var(--font-mono); letter-spacing: .2em; text-transform: uppercase; color: #4A3A22; }
.l-due-kicker { font: 400 15px/1.2 var(--f-typed); color: var(--l-typed); margin-top: 8px; }
.l-due-title { font: 400 clamp(30px, 3vw, 40px)/1.02 var(--f-caslon); color: var(--l-night); }
.l-due-where { font: 700 16px/1.35 var(--font-ui); margin-top: 6px; }
.l-due-where small { display: block; font: 400 15px/1.4 var(--font-ui); }
.l-due-foot { margin-top: 10px; font: 500 11px/1.3 var(--font-mono); letter-spacing: .04em; color: #4A3A22; }
.l-due:hover .l-due-title { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: .12em; }

/* ==========================================================================
   [4] PLACES: card art = a catalog card corner on the night board
   ========================================================================== */
.l-art { background: radial-gradient(ellipse at 100% 0, rgba(154,134,232,.22), transparent 60%), var(--l-night); }
.l-art-card {
  position: absolute; left: 18px; right: 26%; top: 18px; height: 112px; rotate: -2.5deg;
  background: var(--l-buff); border-radius: 2px; padding: 9px 12px; color: var(--l-typed);
  box-shadow: 0 6px 14px rgba(0,0,0,.4);
  font: 400 12.5px/1.35 var(--f-typed);
}
.l-art-card::before { content: ""; position: absolute; left: 10px; right: 10px; top: 30px; height: 1.5px; background: var(--l-rule); }
.l-art-card b { font-weight: 400; display: block; margin-bottom: 9px; }
.l-art-card i { font-style: normal; display: block; color: #4D4656; }
.l-art-hole { position: absolute; right: 16%; bottom: -12px; width: 20px; height: 20px; border-radius: 50%; background: var(--l-night); }
.l-art-spines { position: absolute; right: 12px; bottom: 0; display: flex; align-items: flex-end; gap: 2px; }
.l-art-spines i { width: 11px; border-radius: 1px 1px 0 0; background: var(--c); box-shadow: inset 0 6px 0 -4px rgba(232,220,188,.7); }
.card:hover .l-art-card { rotate: -1deg; translate: 0 -4px; }
.l-art-card { transition: rotate .3s, translate .3s; }

/* compact card monogram: a bookplate oval */
.l-mono { display: grid; place-items: center; background: var(--l-night); }
.l-mono::before { content: ""; position: absolute; width: 54px; height: 66px; border-radius: 50%; border: 1.5px solid var(--l-tan); box-shadow: inset 0 0 0 3px var(--l-night), inset 0 0 0 4px rgba(232,220,188,.5); }
.l-mono b { position: relative; font: 400 19px/1 var(--f-caslon); color: var(--l-tan); letter-spacing: .02em; }
.l-mono b i { font-family: var(--f-caslon-text); font-style: italic; }

/* ==========================================================================
   [5] PEOPLE: a sheet rolled into the typewriter
   ========================================================================== */
.l-people { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(24px, 4vw, 56px); align-items: start; }
.l-typer { position: relative; padding-top: 46px; }
.l-platen {                                  /* the roller and its knobs */
  position: absolute; left: -18px; right: -18px; top: 0; height: 58px; z-index: 2; border-radius: 30px;
  background: linear-gradient(180deg, #4A4558 0, #1F1B2E 34%, #0E0C16 70%, #2C2742);
  box-shadow: 0 10px 16px rgba(31,27,46,.3);
}
.l-platen::before, .l-platen::after { content: ""; position: absolute; top: 9px; width: 30px; height: 40px; border-radius: 8px; background: repeating-linear-gradient(90deg, #2C2742 0 3px, #48425C 3px 5px); }
.l-platen::before { left: -16px; } .l-platen::after { right: -16px; }
.l-paperbail { position: absolute; left: 12%; right: 12%; top: 46px; height: 5px; z-index: 3; background: #C9C3D3; border-radius: 3px; box-shadow: 0 1px 0 rgba(0,0,0,.3); }
.l-sheet {
  position: relative; background: var(--l-grain), #FFFDF6; color: var(--l-typed);
  padding: 42px 30px 26px; box-shadow: 0 18px 36px rgba(31,27,46,.16), inset 0 0 0 1px rgba(0,0,0,.05);
  font-family: var(--f-typed);
}
.l-sheet h3 { font: 400 18px/1.3 var(--f-typed); letter-spacing: .04em; text-transform: uppercase; text-decoration: underline; text-underline-offset: 5px; margin-bottom: 14px; }
.l-sheet ol { list-style: none; counter-reset: ty; }
.l-sheet li { counter-increment: ty; display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 8px; align-items: baseline; padding: 6px 0; }
.l-sheet li::before { content: counter(ty) "."; font-size: 15px; }
.l-sheet li a { font-size: 16.5px; line-height: 1.3; color: var(--l-typed); text-decoration: underline; text-decoration-color: rgba(42,37,51,.35); text-underline-offset: 4px; }
.l-sheet li a:hover { color: var(--l-violet); text-decoration: underline; }
.l-sheet li span { font: 500 11px/1 var(--font-mono); color: #4E4E58; white-space: nowrap; }
.l-sheet-pencil { margin-top: 14px; font: italic 400 15px/1.4 var(--f-caslon-text); color: var(--l-pencil); }
.l-sheet-pencil a { color: var(--l-violet); }
.l-sheet-pencil::before { content: "\2192\00a0"; }

/* ==========================================================================
   [6] TOWNS: an open book: endpaper map on the left, Contents on the right
   ========================================================================== */
.l-towns { background: radial-gradient(ellipse 60% 70% at 50% 0, rgba(154,134,232,.12), transparent 70%), var(--l-night); }
.l-spread {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr);
  background: #3A2F63; padding: 10px; border-radius: 8px;
  box-shadow: 0 30px 60px rgba(0,0,0,.45);
}
.l-spread::after {                            /* the gutter shadow, down the middle of both pages */
  content: ""; position: absolute; left: 50%; top: 10px; bottom: 10px; width: 90px; translate: -50% 0; pointer-events: none;
  background: linear-gradient(90deg, rgba(0,0,0,0), rgba(31,27,46,.16) 42%, rgba(31,27,46,.3) 50%, rgba(31,27,46,.16) 58%, rgba(0,0,0,0));
}
.l-endpaper {                                  /* the map runs across both pages, like real endpapers */
  position: relative; margin: 0; padding: 30px clamp(20px, 4vw, 56px) 20px;
  background:
    radial-gradient(circle at 12% 20%, rgba(75,58,158,.06) 0 2px, transparent 2.5px) 0 0 / 18px 18px,
    var(--l-grain), var(--l-tan);
  border-radius: 3px 3px 0 0; color: var(--l-night);
}
.l-endpaper svg { width: 100%; height: auto; overflow: visible; }
.l-map-land { fill: #EFE5CB; stroke: var(--l-violet); stroke-width: 2.2; stroke-linejoin: round; }
.l-map-hatch { fill: url(#l-hatch); }
.l-map-region { font: italic 400 17px var(--f-caslon-text); fill: #4A3E7A; letter-spacing: .14em; }
.l-map .pin circle { fill: var(--l-violet); stroke: #EFE5CB; stroke-width: 2; }
.l-map .pin text { font: 400 16px var(--f-caslon-text); fill: var(--l-night); paint-order: stroke; stroke: #EFE5CB; stroke-width: 4px; stroke-linejoin: round; }
.l-map .pin .rn { font: 400 12px var(--f-caslon); fill: #fff; stroke: none; text-anchor: middle; }
.l-endpaper figcaption { margin-top: 10px; text-align: center; font: italic 400 15px/1.45 var(--f-caslon-text); color: #3F3757; }
.l-contents {
  background: var(--l-grain), var(--l-page); padding: 30px clamp(20px, 4vw, 56px) 26px; border-radius: 0 0 3px 3px; color: var(--ink);
  border-top: 1px solid #CDBF9E;
}
.l-contents h3 { font: 400 34px/1 var(--f-caslon); color: var(--l-night); text-align: center; letter-spacing: .02em; margin-bottom: 8px; }
.l-contents h3::after { content: "\2766"; display: block; font-size: 18px; color: var(--l-violet); margin-top: 6px; }
.l-parts { columns: 2; column-gap: clamp(60px, 9vw, 150px); }
.l-part { padding-top: 16px; }
.l-part h4 { break-after: avoid; }
.l-part h4 { font: 500 11.5px/1 var(--font-mono); letter-spacing: .22em; text-transform: uppercase; color: var(--l-violet); margin-bottom: 4px; }
.l-part ol { list-style: none; }
.l-part li { break-inside: avoid; }
.l-part li a {
  display: grid; grid-template-columns: 40px auto minmax(16px, 1fr); align-items: baseline; column-gap: 8px;
  padding: 7px 0 5px; text-decoration: none; color: var(--ink);
}
.l-part li a::after { content: ""; grid-column: 3; grid-row: 1; border-bottom: 2px dotted #9A93A8; translate: 0 -5px; }
.l-part .rn { grid-column: 1; grid-row: 1; font: 400 15px/1 var(--f-caslon); color: var(--l-violet); }
.l-part b { grid-column: 2; grid-row: 1; font: 400 22px/1.1 var(--f-caslon); color: var(--l-night); }
.l-part .l-what { grid-column: 2 / -1; font-size: 14.5px; line-height: 1.45; color: var(--muted); margin-top: 3px; }
.l-part li a:hover b { color: var(--l-violet); text-decoration: underline; }
.l-contents-src { margin-top: 18px; text-align: center; font: 500 11px/1.4 var(--font-mono); color: var(--muted); }

/* ==========================================================================
   [7] PRACTICE: catalog cards standing in a drawer
   ========================================================================== */
.l-drawer { position: relative; padding: 18px 18px 0; background: linear-gradient(180deg, #3E2A19, #2E1F12); border-radius: 8px 8px 0 0; }
.l-cards { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; position: relative; }
.l-ccard {
  position: relative; display: flex; flex-direction: column; height: 100%;
  background: var(--l-grain), var(--l-buff); color: var(--l-typed);
  padding: 14px 16px 64px; border-radius: 3px 3px 0 0; font-family: var(--f-typed);
  box-shadow: 0 -1px 0 rgba(255,255,255,.4) inset, 0 -6px 12px rgba(0,0,0,.18);
}
.l-ccard:nth-child(odd) { rotate: -.6deg; } .l-ccard:nth-child(even) { rotate: .5deg; translate: 0 6px; }
.l-ccard-top { display: flex; justify-content: space-between; font-size: 14px; }
.l-ccard h3 { font: 400 15.5px/1.3 var(--f-typed); text-transform: uppercase; letter-spacing: .02em; margin: 6px 0 10px; padding-bottom: 10px; border-bottom: 1.5px solid var(--l-rule); }
.l-ccard p { font-size: 14.5px; line-height: 1.45; margin-bottom: 8px; }
.l-ccard ul { list-style: none; display: grid; gap: 7px; }
.l-ccard li { font-size: 15px; line-height: 1.3; padding-left: 16px; text-indent: -16px; }
.l-ccard li::before { content: "\2013\00a0\00a0"; }
.l-ccard li a { color: var(--l-typed); text-decoration-color: rgba(42,37,51,.4); }
.l-ccard li a:hover { color: var(--l-violet); }
.l-ccard li small { font-size: 13px; color: #4D4656; }
.l-ccard .l-see { margin-top: auto; padding-top: 10px; font-size: 14px; }
.l-ccard .l-see a { color: var(--l-violet); }
.l-ccard::after { content: ""; position: absolute; left: 50%; bottom: 22px; translate: -50% 0; width: 18px; height: 18px; border-radius: 50%; background: #2E1F12; box-shadow: inset 0 2px 3px rgba(0,0,0,.5); }
.l-drawer-front {
  position: relative; z-index: 1; margin: -36px -18px 0; height: 84px; border-radius: 4px;
  background: var(--l-wood); box-shadow: 0 -8px 16px rgba(0,0,0,.25), 0 16px 26px rgba(31,27,46,.2);
  display: flex; align-items: center; justify-content: center; gap: 30px;
}
.l-drawer-label {                             /* brass label holder */
  background: linear-gradient(180deg, #E7CF8E, #B8954A); padding: 5px; border-radius: 3px; box-shadow: 0 1px 0 rgba(255,255,255,.3) inset, 0 2px 3px rgba(0,0,0,.4);
}
.l-drawer-label span { display: block; background: #FBF6E8; padding: 6px 18px; font: 400 15px/1 var(--f-typed); color: var(--l-night); letter-spacing: .08em; }
.l-drawer-pull { width: 64px; height: 22px; border-radius: 0 0 32px 32px; border: 5px solid #C9A65A; border-top: 0; }

/* ==========================================================================
   [8] HERITAGE: a page with pencil marginalia + the book's catalog card
   ========================================================================== */
.l-heritage { background: var(--l-cream); }
.l-heritage-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
.l-leaf {
  position: relative; background: var(--l-grain), var(--l-page); color: var(--ink);
  padding: 34px clamp(96px, 12vw, 150px) 34px clamp(24px, 4vw, 56px);
  box-shadow: 0 2px 0 #E6DCC2, 0 4px 0 #F4EEDF, 0 6px 0 #E3D8BC, 0 22px 40px rgba(31,27,46,.16);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - 48px), calc(100% - 48px) 100%, 0 100%);
}
.l-leaf::after { content: ""; position: absolute; right: 0; bottom: 0; width: 48px; height: 48px; background: linear-gradient(315deg, transparent 0 50%, #D9CCAA 50%, #EDE3C9 80%); }
.l-runhead { display: flex; justify-content: space-between; font: 500 11px/1 var(--font-mono); letter-spacing: .2em; text-transform: uppercase; color: var(--muted); padding-bottom: 12px; border-bottom: 1px solid #DCD2BA; margin-bottom: 20px; }
.l-leaf .block-title { margin-bottom: 16px; }
.l-leaf p.l-body { font: 400 18px/1.7 var(--f-caslon-text); margin-bottom: 14px; max-width: 36em; }
.l-leaf p.l-body:first-of-type::first-letter { float: left; font: 400 66px/.82 var(--f-caslon); color: var(--l-violet); margin: 6px 10px 0 0; }
.l-circ { position: relative; white-space: nowrap; margin-inline: 5px; }
.l-circ::after { content: ""; position: absolute; left: -6px; right: -6px; top: -3px; bottom: -4px; border: 1.6px solid var(--l-pencil); border-radius: 50%; rotate: -3deg; opacity: .85; }
.l-ul { background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='6'%3E%3Cpath d='M0 3 Q 5 0 10 3 T 20 3 T 30 3 T 40 3' fill='none' stroke='%2355505E' stroke-width='1.4'/%3E%3C/svg%3E") 0 100% / 40px 6px repeat-x; padding-bottom: 4px; }
.l-margin {                                    /* pencil notes in the outside margin */
  position: absolute; right: 18px; width: clamp(70px, 9.5vw, 118px);
  font: italic 400 14.5px/1.3 var(--f-caslon-text); color: var(--l-pencil); rotate: -4deg;
}
.l-margin::before { content: ""; display: block; width: 28px; height: 1.5px; background: var(--l-pencil); margin-bottom: 6px; opacity: .7; }
.l-margin.check::after { content: "\2713"; display: block; font: 400 26px/1 var(--font-ui); margin-top: 2px; }
.l-leaf .l-src { font: 500 11px/1.45 var(--font-mono); color: var(--muted); margin-top: 6px; max-width: 60ch; }
.l-leaf .l-folio { display: block; text-align: center; margin-top: 18px; font: 400 15px/1 var(--f-caslon); color: var(--muted); }

.l-catcard {                                   /* the book's catalog card, typed */
  position: relative; background: var(--l-grain), var(--l-buff); color: var(--l-typed);
  padding: 22px 26px 56px; rotate: 2.2deg; font: 400 15.5px/1.5 var(--f-typed);
  box-shadow: 0 16px 30px rgba(31,27,46,.2); max-width: 460px; justify-self: center; width: 100%;
}
.l-catcard::before { content: ""; position: absolute; left: 18px; right: 18px; top: 52px; height: 1.5px; background: var(--l-rule); }
.l-catcard::after { content: ""; position: absolute; left: 50%; bottom: 16px; translate: -50% 0; width: 20px; height: 20px; border-radius: 50%; background: var(--l-cream); box-shadow: inset 0 2px 3px rgba(0,0,0,.25); }
.l-catcard .callno { position: absolute; left: 26px; top: 64px; font-size: 14px; line-height: 1.3; }
.l-catcard dl { margin: 0 0 0 76px; }
.l-catcard dt { margin-bottom: 18px; }
.l-catcard dd { margin: 0 0 6px; text-indent: 1.5em; }
.l-catcard .tracing { margin-top: 14px; font-size: 13.5px; }
.l-catcard .l-cc-stamp { position: absolute; right: 18px; bottom: 26px; rotate: -10deg; border: 2.5px solid var(--l-violet); color: var(--l-violet); border-radius: 3px; padding: 3px 8px; font: 500 12px/1 var(--font-mono); letter-spacing: .12em; text-transform: uppercase; mix-blend-mode: multiply; }

/* ==========================================================================
   [9] LIST-YOUR-PLACE: a book pocket and its borrower's card
   ========================================================================== */
.l-cta { position: relative; overflow: hidden; }
.l-cta::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(90deg, rgba(255,255,255,.04) 0 1px, transparent 1px 22px); pointer-events: none; }
.l-cta .wrap { position: relative; }
.l-cta-grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(24px, 4vw, 56px); align-items: center; }
.l-bookcard { position: relative; width: min(100%, 360px); justify-self: center; padding-top: 0; rotate: -3deg; filter: drop-shadow(10px 14px 0 rgba(31,27,46,.45)); }
.l-bookcard-card {
  position: relative; display: block; background: var(--l-grain), var(--l-buff); color: var(--l-typed);
  padding: 16px 18px 70px; margin: 0 22px; font: 400 15px/1.4 var(--f-typed);
}
.l-bookcard-card b { display: block; font-weight: 400; padding-bottom: 8px; border-bottom: 1.5px solid var(--l-rule); }
.l-bookcard-rows { display: grid; grid-template-columns: 1fr 1.6fr; margin-top: 4px; font: 500 10px/1 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: #4D4656; }
.l-bookcard-rows span { padding: 8px 0 7px; border-bottom: 1px solid #CBBF9F; }
.l-bookcard-rows em { font: 400 15px/1 var(--f-typed); letter-spacing: 0; text-transform: none; color: var(--l-typed); font-style: normal; }
.l-bookcard-stamp { position: absolute; right: 28px; top: 112px; rotate: -12deg; border: 3px solid var(--l-violet); color: var(--l-violet); padding: 4px 10px; font: 500 22px/1 var(--font-mono); letter-spacing: .14em; mix-blend-mode: multiply; }
.l-bookcard-pocket {
  position: relative; display: block; margin-top: -58px; height: 120px; padding: 46px 20px 0; text-align: center;
  background: var(--l-grain), linear-gradient(180deg, #E8D5AA, var(--l-manila)); color: var(--l-night);
  -webkit-mask: radial-gradient(circle at 50% 0, transparent 22px, #000 22.5px); mask: radial-gradient(circle at 50% 0, transparent 22px, #000 22.5px);
  font: 500 10.5px/1.5 var(--font-mono); letter-spacing: .18em; text-transform: uppercase;
}
.l-bookcard-pocket b { display: block; font: 400 21px/1.1 var(--f-caslon); letter-spacing: .02em; text-transform: none; }

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1080px) {
  .l-shelf { grid-template-columns: repeat(7, minmax(0, 1fr)); }
  .l-shelf > li.l-shelf-end { display: none; }
  .l-spine-title { font-size: 19px; }
  .l-people { grid-template-columns: minmax(0, 1fr); }
  .l-typer { max-width: 560px; }
  .l-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .l-hero-grid { grid-template-columns: minmax(0, 1fr); }
  .l-desk { justify-self: center; order: -1; width: min(86%, 400px); margin-bottom: -14px; }
  .l-desk-tag { display: none; }
  .l-hero .hero-title { font-size: clamp(2.3rem, 8.6vw, 3.4rem); }
  .l-events-grid, .l-heritage-grid, .l-cta-grid { grid-template-columns: minmax(0, 1fr); }
  .l-due { min-height: 560px; max-width: 520px; }
  .l-spread::after { display: none; }
  .l-parts { columns: 1; }
  .l-catcard { max-width: 420px; }
}
@media (max-width: 760px) {
  .l-page { clip-path: polygon(0 0, calc(100% - 38px) 0, 100% 38px, 100% 100%, 0 100%); }
  .l-page::after { width: 38px; height: 38px; }
  .l-page-wrap { rotate: 0deg; }
  .l-page-foot { align-items: flex-start; }
  .l-stamp { width: 88px; }
  .l-stamp text:has(> textPath), .l-map .l-map-region { display: none; }   /* 7px tall at phone width: unreadable (WCAG 1.4.4); decorative or repeated in the list */
  .l-hero-shelf { height: 112px; }
  .l-hero-shelf i { height: calc(var(--h) * .74); }
  /* the shelf becomes a stack of books lying flat */
  .l-shelf { display: flex; flex-direction: column; padding: 0 0 22px; }
  .l-shelf::after { display: none; }
  .l-shelf::before { top: auto; bottom: 0; left: -8px; right: -8px; height: 22px; }
  .l-book-slot { height: auto; display: block; }
  .l-spine {
    width: var(--pw, 100%); height: auto; min-height: 76px; margin-left: var(--off, 0);
    flex-direction: column; align-items: flex-start; justify-content: center; padding: 12px 84px 12px 30px;
    background:
      repeating-linear-gradient(90deg, rgba(255,255,255,.035) 0 1px, transparent 1px 3px),
      linear-gradient(180deg, rgba(255,255,255,.14), rgba(255,255,255,0) 30%, rgba(0,0,0,.28)),
      var(--cloth);
    border-radius: 2px 5px 5px 2px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.2), 0 2px 0 rgba(31,27,46,.2);
  }
  .l-spine::before, .l-spine::after { left: auto; right: auto; top: 10px; bottom: 10px; width: 7px; height: auto; border: 0; border-left: 2px solid currentColor; border-right: 1px solid currentColor; }
  .l-spine::before { left: 12px; } .l-spine::after { right: 74px; }
  .l-spine-title { writing-mode: horizontal-tb; margin: 0; max-height: none; text-align: left; font-size: 21px; }
  .l-spine-orn { display: none; }
  .l-callno { left: auto; right: 12px; bottom: 50%; translate: 0 50%; min-width: 50px; font-size: 12.5px; }
  .l-spine-note { display: block; margin-top: 4px; font: 500 11.5px/1.35 var(--font-mono); opacity: .92; }
  .l-note { display: none; }
  .l-book:hover .l-spine, .l-book:focus-visible .l-spine { transform: translateX(8px); }
  .l-due { padding: 22px 18px 24px; min-height: 540px; }
  .l-due-slip { width: 86%; }
  .l-platen { left: 10px; right: 10px; }
  .l-sheet { padding: 40px 18px 22px; }
  .l-sheet li { grid-template-columns: 22px minmax(0, 1fr); }
  .l-sheet li span { grid-column: 2; }
  .l-endpaper, .l-contents { padding: 22px 18px; }
  .l-map .pin text { display: none; }
  .l-map .pin circle { r: 22px; }
  .l-map .pin .rn { font-size: 21px; translate: 0 3px; }
  .l-map-region { display: none; }
  .l-cards { grid-template-columns: minmax(0, 1fr); }
  .l-drawer-front { gap: 16px; }
  .l-drawer-label span { padding: 6px 10px; font-size: 13px; }
  .l-leaf { padding: 26px 20px 30px; }
  .l-margin { position: static; width: auto; rotate: 0deg; margin: -4px 0 14px; }
  .l-margin.check::after { display: inline; margin-left: 8px; font-size: 18px; }
  .l-catcard dl { margin-left: 64px; }
}

@media (prefers-reduced-motion: reduce) {
  .l-caret { animation: none; opacity: 1; }
}

/* ==========================================================================
   HERO MOTION (shared vocabulary across all section heroes)
   - hover / :focus-within moves are one-shot and short: 0.6-1.2 s, eased,
     always ending on the resting pose (the resting pose is unchanged);
   - all of it lives inside prefers-reduced-motion: no-preference AND behind
     .motion-toggle:not(:checked), so reduced motion or the Pause chip means
     no hover motion at all (ambient loops are paused by shell.css);
   - art is aria-hidden and only moves with transform/rotate/translate/opacity:
     no layout shift; nothing moves over a link or input.
   ========================================================================== */
.l-hero-shelf i, .l-openbook { transition: translate .8s cubic-bezier(.3,.7,.3,1), rotate .8s cubic-bezier(.3,.7,.3,1); }
@media (prefers-reduced-motion: no-preference) {
  /* a book tips out of the shelf, as if pulled by the top of its spine */
  .motion-toggle:not(:checked) ~ * .l-hero-shelf i:not(.lean):hover { translate: 0 -8px; rotate: -4deg; }
  .motion-toggle:not(:checked) ~ * .l-hero-shelf i.lean:hover { translate: 0 -8px; }
  /* the open book on the desk lifts toward the reader (hover, or while the search has focus) */
  .motion-toggle:not(:checked) ~ * .l-openbook:hover,
  .motion-toggle:not(:checked) ~ * .l-hero:focus-within .l-openbook { translate: 0 -6px; rotate: -1.2deg; }
}
.motion-toggle:checked ~ * .l-hero-shelf i, .motion-toggle:checked ~ * .l-openbook { transition: none; }

/* hero search: the WHERE field always shows the whole "Town or region" placeholder
   (>= 190px column); on mid widths the button drops to its own row so neither field is squeezed */
@media (min-width: 1201px) { .l-hero .search { grid-template-columns: minmax(0, 1.4fr) minmax(190px, 1fr) auto; } }
@media (min-width: 761px) and (max-width: 1200px) {
  .l-hero .search { grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); }
  .l-hero .search-go { grid-column: 1 / -1; min-height: 52px; }
}
