/* ===== All books (experiment): blue portrait banner, "Currently reading" carousel, full library in the same cards =====
   Accent: slate blue #4C5F76 (from the linen swatch), deepened for the banner. */
.booksp{
  --dusk:#4C5F76; --dusk-ink:#34445A; --dusk-pale:#E7EAEE;
  --in:max(48px, calc((100vw - 1224px) / 2));          /* content inset, matching the site's 1320px column (vw so the bleeding row resolves it the same) */
  --card:color-mix(in srgb, var(--paper) 93%, #6B6150); /* the reference's soft grey card, warmed to the paper */
  --cw:clamp(140px, 10.5vw, 168px);                     /* cover width; covers are 2:3 */
}
html.night .booksp{--dusk:#9AA8BA; --dusk-ink:#C0C9D4; --dusk-pale:#242C36; --card:color-mix(in srgb, var(--paper) 90%, #EAE4D8)}
main.booksp{max-width:none;padding:0 0 128px}

/* ---------- banner ---------- */
.abhero{position:relative;height:clamp(380px, 38vw, 560px);overflow:hidden;
  background:#1C2530 var(--img) right center / cover no-repeat;isolation:isolate}
/* the faintest top shade so the header line reads against the sky; the reference has a hairline under its nav */
.abhero::before{content:"";position:absolute;inset:0;z-index:-1;
  background:linear-gradient(180deg, rgba(10,16,26,.28), transparent 22%),
             radial-gradient(60% 70% at 46% 52%, rgba(10,16,26,.22), transparent 70%)}
.abhero::after{content:"";position:absolute;inset:auto 0 0;height:1px;background:rgba(255,255,255,.08)}
.abhero-in{position:absolute;left:31%;top:50%;transform:translateY(-54%);width:min(31%, 460px);min-width:340px}

.abchips{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:12px}
.abchip{display:inline-flex;align-items:center;gap:5px;height:24px;padding:0 11px;border-radius:7px;
  font:400 12.5px/1 var(--text);letter-spacing:.01em;color:#2a2621;
  background:#fff;border:1px solid rgba(255,255,255,.9);
  box-shadow:0 1px 1px rgba(0,0,0,.08), 0 2px 6px -2px rgba(0,0,0,.25);cursor:pointer;
  transition:background .2s, color .2s}
.abchip svg{width:9px;height:9px;fill:none;stroke:currentColor;stroke-width:1.4;stroke-linecap:round;margin-left:-2px}
.abchip:hover{color:#1C1B19}
.abchip.on{color:#1C1B19;box-shadow:inset 0 0 0 1px color-mix(in srgb, var(--dusk) 55%, transparent), 0 1px 1px rgba(0,0,0,.08), 0 2px 6px -2px rgba(0,0,0,.25)}
.abchip:focus-visible{outline:2px solid #fff;outline-offset:2px}

.absearch{display:flex;align-items:center;gap:10px;height:44px;padding:0 14px;border-radius:7px;background:#fff;cursor:text;
  box-shadow:0 1px 2px rgba(0,0,0,.12), 0 6px 18px -6px rgba(5,12,22,.45)}
.absearch svg{width:17px;height:17px;flex:none;fill:none;stroke:#1C1B19;stroke-width:1.9;stroke-linecap:round}
.absearch input{flex:1;min-width:0;border:0;outline:0;background:none;padding:0;
  font:400 17px/1 var(--text);color:#1C1B19;caret-color:var(--dusk-ink)}
.absearch input::placeholder{color:#9a948a}
.absearch input::-webkit-search-cancel-button{-webkit-appearance:none}
.absearch:focus-within{box-shadow:0 0 0 3px rgba(255,255,255,.35), 0 6px 18px -6px rgba(5,12,22,.45)}

.abtag{margin:14px 0 0;font:400 16.5px/1.42 var(--text);color:#F4F1EA;letter-spacing:.005em;
  text-shadow:0 1px 10px rgba(8,14,24,.45);max-width:34em}

/* ---------- sections ---------- */
.absec{padding:44px var(--in) 0}
.absec + .absec{padding-top:64px}
.abpill{display:inline-block;padding:4px 8px 3px;border-radius:6px;font:400 11.5px/1 var(--text);color:var(--ink);
  background:var(--paper);border:1px solid var(--line);box-shadow:0 1px 2px rgba(0,0,0,.06)}
.abh{margin:8px 0 22px;font:400 30px/1.15 var(--text);letter-spacing:-.005em;color:var(--ink)}

/* ---------- the card (shared by the carousel and the grid) ---------- */
.abc{display:flex;gap:clamp(18px, 1.6vw, 24px);padding:clamp(16px, 1.3vw, 20px);border-radius:6px;background:var(--card);
  color:var(--ink);text-decoration:none;
  box-shadow:0 1px 1px rgba(40,30,20,.04), 0 10px 26px -14px rgba(40,30,20,.28);
  transition:background-color .35s var(--ease, ease), color .35s var(--ease, ease), transform .35s var(--ease, ease), box-shadow .35s}
.abcv{flex:none;width:var(--cw);aspect-ratio:2/3;border-radius:3px;overflow:hidden;background:#fff;
  box-shadow:0 1px 2px rgba(0,0,0,.14), 0 12px 22px -10px rgba(0,0,0,.4)}
.abcv img{display:block;width:100%;height:100%;object-fit:cover}
.abtx{display:flex;flex-direction:column;min-width:0;padding-top:2px}
.abtop{display:flex;align-items:center;gap:7px;height:16px;margin-bottom:12px;font:500 12px/1 var(--ui);color:var(--ink3);letter-spacing:.01em}
.abdot{opacity:.5}
.abmeter{position:relative;width:84px;height:3px;border-radius:2px;background:color-mix(in srgb, var(--dusk) 20%, transparent);overflow:hidden}
.abmeter i{position:absolute;inset:0 auto 0 0;width:var(--p);background:var(--dusk);border-radius:2px}
.abpct{color:var(--dusk);font-weight:600}
.abt{font:600 clamp(23px, 1.75vw, 27px)/1.12 var(--text);letter-spacing:-.005em;text-wrap:balance}
.abs{margin-top:4px;font:400 clamp(18px, 1.3vw, 20px)/1.25 var(--text);color:var(--ink2)}
.abd{margin-top:12px;font:400 16px/1.4 var(--text);color:var(--ink2);
  display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:5;overflow:hidden}

/* hover: the card takes the dusty blue, the way the reference's third card takes its cover's ochre */
@media (hover:hover){
  .abc:hover{background:var(--dusk);color:#F3EEE5;transform:translateY(-2px);
    box-shadow:0 1px 1px rgba(20,30,45,.08), 0 18px 34px -16px rgba(20,32,48,.55)}
  .abc:hover .abs,.abc:hover .abd{color:rgba(243,238,229,.82)}
  .abc:hover .abtop,.abc:hover .abpct{color:rgba(243,238,229,.75)}
  .abc:hover .abmeter{background:rgba(243,238,229,.22)}.abc:hover .abmeter i{background:#F3EEE5}
  html.night .booksp .abc:hover{background:#3A4A5E}
}
.abc:focus-visible{outline:2px solid var(--dusk);outline-offset:3px}

/* currently reading: laid out in the same grid as the library, so every card sits fully inside the column (it used to bleed off the right edge and clip the last book) */
.abrow{display:grid;grid-template-columns:repeat(auto-fill, minmax(min(100%, 500px), 1fr));gap:clamp(20px, 2vw, 30px)}
.abrow:focus-visible{outline:none}

/* the full library: the same card, in a grid */
.abgrid{display:grid;grid-template-columns:repeat(auto-fill, minmax(min(100%, 500px), 1fr));gap:clamp(20px, 2vw, 30px)}
.abgrid .abc[hidden]{display:none}
.abnone{margin:8px 0 0;font:italic 400 18px/1.4 var(--text);color:var(--ink3)}

/* ---------- phone / narrow ---------- */
@media (max-width:1100px){
  .abhero{background-position:72% center}
  .abhero-in{left:var(--in);width:min(46%, 440px)}
}
@media (max-width:900px){
  .booksp{--in:18px;--cw:104px}
  .abhero{height:440px;background-image:var(--img-sm);background-position:76% center}
  .abhero::before{background:linear-gradient(180deg, rgba(10,16,26,.55), rgba(10,16,26,.15) 70%, rgba(10,16,26,.35))}
  .abhero-in{left:18px;right:18px;top:auto;bottom:28px;transform:none;width:auto;min-width:0}
  .abchips{flex-wrap:wrap}
  .abtag{font-size:15.5px}.abtag br{display:none}
  .abh{font-size:26px}
  .abt{font-size:21px}.abs{font-size:17px}.abd{font-size:15px;-webkit-line-clamp:4}
}
@media (prefers-reduced-motion:reduce){.abc{transition:none}.abc:hover{transform:none}}


/* ---------- day: no blue at all. The banner is a pale warm print that tones into the paper; type goes to ink,
   the controls sit on it like the reference's white pills on a light page, and the accent is warm ink ---------- */
html:not(.night) .booksp{--dusk:#2A2621; --dusk-ink:#1C1B19; --dusk-pale:#EFEBE3}
html:not(.night) .abhero{background-color:#EEEAE2;background-image:var(--img-day)}
html:not(.night) .abhero::before{
  background:radial-gradient(42% 60% at 42% 50%, rgba(245,243,238,.38), transparent 72%),
             linear-gradient(0deg, rgba(245,243,238,.22), transparent 10%)}   /* the lower edge melts into the page */
html:not(.night) .abhero::after{background:rgba(28,27,25,.07)}
html:not(.night) .abchip{border-color:rgba(28,27,25,.10);box-shadow:0 1px 1px rgba(40,30,20,.05), 0 2px 6px -3px rgba(40,30,20,.18)}
html:not(.night) .abchip.on{box-shadow:inset 0 0 0 1px rgba(28,27,25,.55), 0 1px 1px rgba(40,30,20,.05)}
html:not(.night) .abchip:focus-visible{outline-color:var(--ink)}
html:not(.night) .absearch{box-shadow:0 0 0 1px rgba(28,27,25,.09), 0 1px 2px rgba(40,30,20,.06), 0 8px 22px -10px rgba(40,30,20,.25)}
html:not(.night) .absearch:focus-within{box-shadow:0 0 0 1px rgba(28,27,25,.35), 0 8px 22px -10px rgba(40,30,20,.25)}
html:not(.night) .abtag{color:var(--ink2);text-shadow:0 0 14px rgba(245,243,238,.9)}
@media (max-width:900px){
  html:not(.night) .abhero{background-image:var(--img-day-sm)}
  html:not(.night) .abhero::before{background:linear-gradient(180deg, rgba(245,243,238,.15), rgba(245,243,238,.55) 55%, rgba(245,243,238,.75))}
}
/* subject filters: one line on desktop, even if it runs a little past the search field; phones wrap */
@media (min-width:901px){.abchips{flex-wrap:nowrap;width:max-content}}

/* ===================== view toggle: Cards / Books ===================== */
.abfirst{position:relative}
.abview{position:absolute;right:var(--in);top:44px;display:flex;border:1px solid var(--line);background:var(--paper);background-image:var(--paper-tex);background-attachment:fixed}
.abview button{font:500 12px/1 var(--ui);letter-spacing:.02em;color:var(--ink3);padding:8px 14px;background:none;border:0;cursor:pointer}
.abview button+button{border-left:1px solid var(--line)}
.abview button[aria-pressed=true]{color:var(--paper);background:var(--ink)}
.abview button:focus-visible{outline:2px solid var(--red);outline-offset:2px}

/* ===================== Books view (experiment) =====================
   Each book stands alone on the paper, no card: the cover is the object. After the reference (Penguin / Criterion
   covers laid on kraft): a tight contact shadow where the book meets the surface, a soft cast shadow falling
   down-right from a light up-left, a faint hinge crease near the spine, and a whisper of light across the board. */
.ab-books .booksp .abc{display:flex;flex-direction:column;gap:14px;padding:0;background:none!important;box-shadow:none!important;transform:none}
.ab-books .booksp .abtx{padding:0}
.ab-books .booksp .abt,.ab-books .booksp .abs,.ab-books .booksp .abd{display:none}
.ab-books .booksp .abtop{margin:0;height:auto;justify-content:flex-start;color:var(--ink3)}
.ab-books .booksp .abcv{position:relative;width:100%;overflow:visible;background:#fff;
  box-shadow:
    0 1px 1px rgba(45,28,12,.22),                 /* contact: where the board touches the paper */
    1px 3px 4px -1px rgba(45,28,12,.20),          /* near shadow */
    6px 14px 22px -6px rgba(45,28,12,.32),        /* cast, down-right */
    14px 30px 46px -18px rgba(45,28,12,.30);      /* the long soft fall-off */
  transition:transform .45s var(--ease, cubic-bezier(.2,.7,.2,1)),box-shadow .45s var(--ease, cubic-bezier(.2,.7,.2,1))}
/* the hinge: a thin crease a few px in from the spine, lit on one side, shaded on the other */
.ab-books .booksp .abcv::before{content:"";position:absolute;inset:0;z-index:1;pointer-events:none;
  background:linear-gradient(90deg, rgba(0,0,0,.10) 0, rgba(0,0,0,.02) 1.6%, rgba(255,255,255,.55) 2.6%, rgba(0,0,0,.07) 3.8%, transparent 7%)}
/* light across the board from the top left; a hair of shade at the fore-edge */
.ab-books .booksp .abcv::after{content:"";position:absolute;inset:0;z-index:1;pointer-events:none;
  background:linear-gradient(118deg, rgba(255,255,255,.10), transparent 38%, transparent 70%, rgba(40,25,10,.06)),
             linear-gradient(270deg, rgba(40,25,10,.08), transparent 1.5%)}
.ab-books .booksp .abcv img{position:relative;z-index:0}
@media (hover:hover){
  .ab-books .booksp .abc:hover{background:none!important;transform:none}
  .ab-books .booksp .abc:hover .abcv{transform:translateY(-6px) rotate(-.4deg);
    box-shadow:0 1px 1px rgba(45,28,12,.16),2px 6px 8px -2px rgba(45,28,12,.18),10px 26px 34px -10px rgba(45,28,12,.34),22px 46px 64px -22px rgba(45,28,12,.30)}
  .ab-books .booksp .abc:hover .abtop,.ab-books .booksp .abc:hover .abpct{color:var(--ink3)}
  .ab-books .booksp .abc:hover .abmeter{background:color-mix(in srgb, var(--dusk) 20%, transparent)}
  .ab-books .booksp .abc:hover .abmeter i{background:var(--dusk)}
}
/* layout: generous air between books, like objects laid out on a table */
.ab-books .booksp .abrow{display:flex!important;flex-wrap:nowrap;overflow-x:auto;gap:clamp(36px,4vw,64px);padding-bottom:40px;
  margin:0 calc(-1 * var(--in));padding-left:var(--in);padding-right:var(--in);scrollbar-width:none}
.ab-books .booksp .abrow .abc{flex:none;width:clamp(170px,15vw,230px)}
.ab-books .booksp .abgrid{grid-template-columns:repeat(auto-fill,minmax(clamp(150px,13vw,200px),1fr));gap:clamp(44px,4.4vw,72px) clamp(36px,4vw,64px)}
/* night: the shadows go blue-black and stronger, covers keep their slight dimming */
html.night.ab-books .booksp .abcv{box-shadow:0 1px 1px rgba(0,0,0,.5),1px 3px 4px -1px rgba(0,0,0,.45),6px 14px 22px -6px rgba(2,6,14,.65),14px 30px 46px -18px rgba(2,6,14,.6)}
@media (max-width:900px){
  .abview{position:static;margin:0 0 18px;width:max-content}
  .ab-books .booksp .abgrid{grid-template-columns:repeat(2,1fr);gap:36px 24px}
  .ab-books .booksp .abrow .abc{width:42vw}
}


/* ===== no banner: the filters and search sit in one quiet row above the library (All books and home) ===== */
.abtools{display:flex;align-items:center;gap:18px;flex-wrap:wrap;margin:-4px 0 30px}
.abtools .abchips{margin:0;flex-wrap:wrap;width:auto}
.abtools .absearch{width:min(340px,100%);height:40px;margin-left:auto;background:var(--card,#fff)}
.abtools .absearch input{font-size:16.5px}
.abchip{border:1px solid var(--line)!important}
html.night .abchip{background:var(--card2,#1D2635);color:var(--ink);border-color:var(--hair2)!important}
html.night .abchip.on{background:var(--ink);color:var(--paper)}
html.night .abtools .absearch{background:var(--card2,#1D2635)}
html.night .abtools .absearch input{color:var(--ink)}html.night .abtools .absearch svg{stroke:var(--ink)}
/* All books opens straight on Currently reading */
.booksp > .absec.abfirst{padding-top:clamp(28px,4vw,56px)}
/* home: the library follows Suggested directly */
main.home .homelib{padding-bottom:120px}
main.home .homelib .ablib{padding-top:clamp(40px,5vw,72px)}
main.home .below{padding-bottom:0!important}
@media (max-width:900px){.abtools .absearch{margin-left:0;width:100%}}

/* ===== card hover: no dark fill. The card lifts a little and its surface turns slightly more solid (lighter, less
   see-through to the paper); text keeps its colours. Cards view only — the Books view has its own hover. ===== */
.abtools .absearch{background:#FBF9F5}
html.night .abtools .absearch{background:var(--card2,#1D2635)}
@media (hover:hover){
  html:not(.ab-books) .booksp .abc:hover,html:not(.ab-books):not(.night) .booksp .abc:hover,html.night:not(.ab-books) .booksp .abc:hover{
    background:color-mix(in srgb,var(--card) 55%,#FFFDF8)!important;color:var(--ink)!important;transform:translateY(-3px)!important;
    box-shadow:0 1px 1px rgba(40,30,20,.05),0 18px 36px -18px rgba(40,30,20,.34)!important}
  html.night:not(.ab-books) .booksp .abc:hover{background:color-mix(in srgb,var(--card) 88%,#ECE7DD)!important;box-shadow:0 18px 36px -16px rgba(0,0,0,.6)!important}
  html:not(.ab-books) .booksp .abc:hover .abs,html:not(.ab-books) .booksp .abc:hover .abd{color:var(--ink2)!important}
  html:not(.ab-books) .booksp .abc:hover .abtop{color:var(--ink3)!important}
  html:not(.ab-books) .booksp .abc:hover .abpct{color:var(--dusk)!important}
  html:not(.ab-books) .booksp .abc:hover .abmeter{background:color-mix(in srgb,var(--dusk) 20%,transparent)!important}
  html:not(.ab-books) .booksp .abc:hover .abmeter i{background:var(--dusk)!important}
}

/* ===== no box around the cards: cover and text sit straight on the paper (Cards view, day and night).
   On hover only the book moves: the cover lifts a little; the card, its text and its colours stay put.
   Prefixed with #app so it outranks the older card-hover rules above. ===== */
html:not(.ab-books) #app .booksp .abc,
html:not(.ab-books) #app .booksp .abc:hover{background:none!important;box-shadow:none!important;transform:none!important;padding:0!important;border-radius:0;color:var(--ink)!important}
html:not(.ab-books) #app .booksp .abc .abcv{transition:transform .35s cubic-bezier(.2,.7,.2,1),box-shadow .35s}
@media (hover:hover){
  html:not(.ab-books) #app .booksp .abc:hover .abcv{transform:translateY(-4px)}
}
@media (prefers-reduced-motion:reduce){html:not(.ab-books) #app .booksp .abc:hover .abcv{transform:none}}

/* ===== the full library, simply: covers in a grid, the title and year beneath each ===== */
.lbgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(clamp(140px,12vw,180px),1fr));gap:clamp(40px,4vw,60px) clamp(28px,3vw,48px);margin-top:8px}
.lb{display:flex;flex-direction:column;gap:12px;color:inherit;text-decoration:none}
.lbcv{position:relative;display:block;aspect-ratio:2/3;background:#fff;transition:transform .35s cubic-bezier(.2,.7,.2,1)}
.lbcv img{position:relative;z-index:0;display:block;width:100%;height:100%;object-fit:cover}
.lbt{font:400 17px/1.25 var(--text);color:var(--ink);text-wrap:balance}
.lby{margin-top:-8px;font:400 15px/1 var(--text);color:var(--ink3);font-variant-numeric:oldstyle-nums}
@media (hover:hover){.lb:hover .lbcv{transform:translateY(-4px)}.lb:hover .lbt{color:var(--red)}}
.lb:focus-visible{outline:2px solid var(--red);outline-offset:6px}
@media (max-width:700px){.lbgrid{grid-template-columns:repeat(2,1fr);gap:32px 20px}}
/* Currently reading, same simple layout: cover, title, "Chapter 3 · 32%", a hairline of progress */
.lbbar{display:block;height:2px;margin-top:-2px;background:color-mix(in srgb,var(--red) 18%,transparent)}
.lbbar i{display:block;height:100%;background:var(--red)}
.lbrow .lby{font-variant-numeric:lining-nums}
html.ab-books .booksp .lbcv{transform:none}

/* ===== library: Date · Theme · Recent on the right of the heading — three quiet words, the current one underlined ===== */
.libhd{display:flex;align-items:baseline;justify-content:space-between;gap:20px;flex-wrap:wrap}
.libsort{display:flex;gap:22px}
.libsort button{all:unset;cursor:pointer;font:400 17px/1 var(--text);font-variant-caps:all-small-caps;letter-spacing:.06em;color:var(--ink3);
  padding-bottom:3px;border-bottom:1px solid transparent;transition:color .2s,border-color .2s}
.libsort button[aria-pressed=true]{color:var(--ink);border-bottom-color:var(--ink)}
@media (hover:hover){.libsort button:hover{color:var(--ink)}}
.libsort button:focus-visible{outline:2px solid var(--red);outline-offset:4px}
/* each group: a small heading (and its years), then its books */
.libgrp + .libgrp{margin-top:clamp(48px,5vw,72px)}
.libgh{margin:6px 0 22px;font:400 23px/1.2 var(--text)!important;color:var(--ink);display:flex;align-items:baseline;gap:14px;
  padding-bottom:10px;border-bottom:1px solid var(--line)}
.libgh span{font-size:16px;color:var(--ink3);font-variant-numeric:lining-nums;letter-spacing:.02em}
