/* Shirley Thompson — site styles */

:root {
  /* Heritage green: bottle green + antique gold on warm cream */
  --paper: #f8f5ec;
  --paper-2: #eeeadb;
  --card: #fffefa;
  --ink: #1f2a24;
  --ink-2: #4c574f;
  --ink-3: #7c857d;
  --rule: #dfdccb;
  --accent: #2f5d4a;
  --accent-hover: #244a3b;
  --accent-ink: #ffffff;
  --accent-soft: #e2ebe2;
  --highlight: #d9b765;
  --navy: #1f3329;           /* dark sections and footer */
  --navy-ink: #f3f1e8;
  --navy-ink-2: #c9d2c8;
  --glow-1: rgba(217, 183, 101, .26);
  --glow-2: rgba(47, 93, 74, .08);
  --btn-shadow: rgba(47, 93, 74, .25);
  --portrait-bg: #d9e2d6;
  --callout-ink: #dbe8df;
  --footer-muted: #9fb0a4;
  --shadow: 0 1px 2px rgba(25, 40, 30, .06), 0 10px 28px rgba(25, 40, 30, .09);
  --cover-shadow: 0 2px 4px rgba(25, 40, 30, .18), 0 16px 32px rgba(25, 40, 30, .22);
  --radius: 14px;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: "Source Sans 3", "Segoe UI", system-ui, -apple-system, sans-serif;
  --wrap: 1120px;
  --gutter: clamp(16px, 4vw, 32px);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 90px; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.125rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 .5em;
  font-variation-settings: "opsz" 96;
}
h1 { font-size: clamp(2.3rem, 5.2vw, 3.9rem); }
h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); }
h3 { font-size: clamp(1.35rem, 2.2vw, 1.65rem); }

p { margin: 0 0 1em; }

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

.skip {
  position: absolute; left: -999px; top: 8px;
  background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 6px; z-index: 100;
}
.skip:focus { left: 8px; }

.eyebrow {
  display: inline-block;
  font-family: var(--sans);
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: .9rem;
}

.lede { font-size: clamp(1.15rem, 1.8vw, 1.3rem); color: var(--ink-2); max-width: 38em; }
.muted { color: var(--ink-2); }

/* ---------- Header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251, 248, 243, .9);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--rule);
}
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; }

.brand { text-decoration: none; color: var(--ink); display: flex; flex-direction: column; line-height: 1.1; }
.brand-name { font-family: var(--serif); font-style: italic; font-size: 1.6rem; font-weight: 500; letter-spacing: -0.01em; }
.brand-tag { font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); margin-top: 3px; }

.nav ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; }
.nav a {
  display: block; padding: 8px 14px; border-radius: 999px;
  color: var(--ink); text-decoration: none; font-size: 1rem; font-weight: 500;
}
.nav a:hover { background: var(--paper-2); }
.nav a[aria-current="page"] { background: var(--ink); color: var(--paper); }

.nav-toggle {
  display: none;
  background: none; border: 1px solid var(--rule); border-radius: 10px;
  width: 44px; height: 44px; padding: 0; cursor: pointer; color: var(--ink);
}
.nav-toggle svg { width: 22px; height: 22px; margin: auto; display: block; }

@media (max-width: 820px) {
  .nav-toggle { display: block; }
  .nav {
    position: absolute; left: 0; right: 0; top: 100%;
    background: var(--paper); border-bottom: 1px solid var(--rule);
    display: none; padding: 8px var(--gutter) 16px;
  }
  .nav.open { display: block; }
  .nav ul { flex-direction: column; }
  .nav a { padding: 12px 14px; border-radius: 10px; font-size: 1.1rem; }
}

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 22px; border-radius: 999px;
  font-family: var(--sans); font-size: 1rem; font-weight: 600;
  text-decoration: none; border: 1.5px solid transparent; cursor: pointer;
  transition: transform .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 6px 18px var(--btn-shadow); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn-ghost:hover { background: var(--ink); color: var(--paper); }
.btn-light { background: var(--paper); color: var(--ink); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 1.6rem; }

/* ---------- Sections ---------- */

.section { padding: clamp(56px, 9vw, 110px) 0; }
.section-alt { background: var(--paper-2); }
.section-dark { background: var(--navy); color: var(--navy-ink); }
.section-dark .eyebrow { color: var(--highlight); }
.section-dark .muted, .section-dark p { color: var(--navy-ink-2); }
.section-dark h2, .section-dark h3 { color: #fff; }

.section-head { max-width: 44em; margin-bottom: clamp(28px, 4vw, 48px); }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.split-media-left { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); }
@media (max-width: 860px) {
  .split, .split-media-left { grid-template-columns: 1fr; }
}

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

.hero { padding: clamp(40px, 7vw, 96px) 0 clamp(56px, 8vw, 110px); overflow: hidden; }
.hero .split { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.hero h1 em { font-style: italic; color: var(--accent); }
@media (max-width: 860px) { .hero .split { grid-template-columns: 1fr; } }

.hero-art { position: relative; justify-self: center; width: min(340px, 100%); padding: 0 0 56px 0; margin-left: 70px; }
.portrait {
  /* Cleaned-up, enlarged copy of the photo from the old header banner */
  display: block; width: 100%; height: auto;
  aspect-ratio: 540 / 582; object-fit: cover;
  border-radius: 18px;
  background-color: var(--portrait-bg);
  box-shadow: var(--shadow);
  border: 8px solid #fff;
}
/* Book cover tucked against the lower-left corner, clear of Shirley */
.hero-cover {
  position: absolute; left: -76px; bottom: 0; width: 30%;
  border-radius: 4px; box-shadow: var(--cover-shadow);
  transform: rotate(-5deg);
  border: 4px solid #fff;
}
@media (max-width: 860px) {
  .hero-art { margin-left: 0; width: min(300px, 78%); justify-self: end; margin-right: 4%; }
  .hero-cover { left: -22%; width: 32%; }
}

/* ---------- Book cover crop for the old sidebar image ---------- */

/* Covers always fill their frame edge to edge */
.cover-crop { object-fit: cover; height: auto; aspect-ratio: 354 / 500; }

.flyer { width: 100%; max-width: 720px; margin: 0 auto 56px; border-radius: 12px; box-shadow: var(--shadow); border: 6px solid #fff; }

/* ---------- Book feature ---------- */

.book-feature .cover-frame { display: flex; justify-content: center; }
.book-feature .cover-frame img { width: min(260px, 70%); border-radius: 4px; box-shadow: var(--cover-shadow); }

.facts { display: flex; flex-wrap: wrap; gap: 8px; margin: 1.2rem 0 0; padding: 0; list-style: none; }
.facts li {
  font-size: .92rem; padding: 6px 12px; border-radius: 999px;
  background: var(--accent-soft); color: var(--ink);
}
.facts li strong { font-weight: 600; }
.section-dark .facts li { background: rgba(255, 255, 255, .08); color: var(--navy-ink); }

/* ---------- Photo grid & lightbox ---------- */

.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; margin-top: 24px; }
.photo-grid a { display: block; border-radius: 10px; overflow: hidden; background: var(--paper-2); }
.photo-grid img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .35s ease; }
.photo-grid a:hover img { transform: scale(1.04); }
.photo-grid.small { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
.caption { font-size: .92rem; color: var(--ink-3); margin-top: 10px; }

.lightbox {
  border: 0; padding: 0; background: transparent; max-width: 94vw; max-height: 92vh;
  overflow: visible;
}
.lightbox::backdrop { background: rgba(12, 18, 32, .88); }
.lightbox img { max-width: 94vw; max-height: 82vh; width: auto; border-radius: 8px; margin: 0 auto; }
.lightbox p { color: #dfe4ee; text-align: center; font-size: .95rem; margin: 10px 0 0; }
.lb-btn {
  position: fixed; background: rgba(255, 255, 255, .12); color: #fff; border: 0;
  width: 48px; height: 48px; border-radius: 999px; font-size: 1.5rem; cursor: pointer; line-height: 1;
}
.lb-btn:hover { background: rgba(255, 255, 255, .25); }
.lb-close { top: 16px; right: 16px; }
.lb-prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 12px; top: 50%; transform: translateY(-50%); }

/* ---------- Musical ---------- */

.poster { width: min(300px, 80%); margin: 0 auto; border-radius: 6px; box-shadow: 0 20px 50px rgba(0, 0, 0, .4); }

/* ---------- Cards ---------- */

.card {
  background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius);
  padding: clamp(22px, 3.5vw, 36px); box-shadow: var(--shadow);
}

.quote {
  font-family: var(--serif); font-style: italic; font-size: clamp(1.3rem, 2.4vw, 1.65rem);
  line-height: 1.4; margin: 1.6rem 0; padding-left: 22px; border-left: 3px solid var(--accent); color: var(--ink);
}
.quote cite { display: block; font-family: var(--sans); font-style: normal; font-size: .95rem; color: var(--ink-3); margin-top: 10px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 1rem 0 0; }
.chips li { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--rule); background: var(--paper); font-size: .98rem; }

/* ---------- Bookshelf ---------- */

.shelf { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 32px 22px; }
.shelf a { text-decoration: none; color: var(--ink); display: block; }
/* Covers fill their tile, sitting on a soft "shelf" with a little 3D tilt on hover */
.shelf .cover-wrap {
  position: relative; perspective: 700px;
  background: linear-gradient(var(--paper-2), var(--paper-2)) bottom / 100% 62% no-repeat;
  border-radius: 10px; padding: 0 14px 14px;
  transition: background-color .25s ease;
}
.shelf img {
  display: block; width: 100%; height: auto; aspect-ratio: 92 / 130; object-fit: cover;
  border-radius: 3px 5px 5px 3px; box-shadow: var(--cover-shadow);
  transform-origin: left center;
  transition: transform .45s cubic-bezier(.2, .8, .2, 1), box-shadow .45s ease;
}
.shelf a:hover img, .shelf a:focus-visible img {
  transform: translateY(-6px) rotateY(-14deg);
  box-shadow: 10px 18px 30px rgba(25, 40, 30, .28);
}
.shelf .t { transition: color .2s ease; }
.shelf a:hover .t { color: var(--accent); }
.shelf .t { font-family: var(--serif); font-size: 1.08rem; line-height: 1.25; margin-top: 12px; }
.shelf .k { font-size: .85rem; color: var(--ink-3); margin-top: 2px; }

/* ---------- Timeline ---------- */

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 90px 1fr; gap: 18px; padding: 18px 0; border-top: 1px solid var(--rule); }
.timeline li:last-child { border-bottom: 1px solid var(--rule); }
.timeline .when { font-family: var(--serif); font-size: 1.25rem; color: var(--accent); }
.timeline h3 { font-size: 1.2rem; margin-bottom: .25em; }
.timeline p { margin: 0; color: var(--ink-2); font-size: 1.02rem; }

/* ---------- Callout ---------- */

.callout {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px;
  background: var(--accent); color: #fff; border-radius: var(--radius);
  padding: clamp(24px, 4vw, 40px) clamp(22px, 4vw, 48px);
}
.callout h2 { color: #fff; margin: 0 0 .2em; font-size: clamp(1.5rem, 2.8vw, 2rem); }
.callout p { margin: 0; color: var(--callout-ink); }

/* ---------- Inner page header ---------- */

.page-head { padding: clamp(44px, 7vw, 90px) 0 clamp(28px, 4vw, 48px); border-bottom: 1px solid var(--rule); }
.page-head h1 { max-width: 16em; }

.toc { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 1.6rem; list-style: none; padding: 0; }
.toc a {
  display: block; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--rule);
  background: var(--card); text-decoration: none; color: var(--ink); font-size: .95rem;
}
.toc a:hover { border-color: var(--accent); color: var(--accent); }

/* ---------- Book entries (inner pages) ---------- */

.book { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); padding: clamp(40px, 6vw, 72px) 0; border-bottom: 1px solid var(--rule); }
.book:last-of-type { border-bottom: 0; }
.book-cover img { width: 100%; max-width: 190px; border-radius: 3px; box-shadow: var(--cover-shadow); position: sticky; top: 100px; }
.book h2 { font-size: clamp(1.7rem, 3vw, 2.3rem); margin-bottom: .2em; }
.book .by { color: var(--ink-3); font-size: 1rem; margin-bottom: 1.2rem; }
.book .body { max-width: 40em; }
.book .note { font-size: 1rem; color: var(--ink-2); background: var(--accent-soft); border-radius: 10px; padding: 12px 16px; display: inline-block; }
.book .stores { font-size: 1rem; color: var(--ink-2); margin-top: 1rem; }
.book blockquote {
  margin: 1.4rem 0; padding: 18px 22px; background: var(--paper-2); border-radius: 10px;
  font-family: var(--serif); font-style: italic; color: var(--ink-2); font-size: 1.1rem;
}
.inline-photo { margin: 1.4rem 0; max-width: 320px; border-radius: 10px; box-shadow: var(--shadow); }

@media (max-width: 640px) {
  .book { grid-template-columns: 1fr; }
  .book-cover img { position: static; max-width: 140px; }
}

/* ---------- Links page ---------- */

.link-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.link-card { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); transition: border-color .2s ease, transform .2s ease; }
.link-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.link-card h2 { font-size: 1.35rem; margin-bottom: .4em; }
.link-card p { color: var(--ink-2); font-size: 1.02rem; flex: 1; }
.link-card .go { font-size: .95rem; font-weight: 600; color: var(--accent); }
@media (max-width: 400px) { .link-list { grid-template-columns: 1fr; } }

/* ---------- Contact ---------- */

.contact-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(28px, 5vw, 64px); align-items: start; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }

.phone { font-family: var(--serif); font-size: clamp(1.7rem, 3vw, 2.2rem); color: var(--ink); text-decoration: none; display: block; width: fit-content; line-height: 1.1; margin: 0 0 .6rem; }
.phone:hover { color: var(--accent); }
.phone-label { font-family: var(--sans); font-size: .78rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); vertical-align: middle; margin-left: 4px; }

.form { display: grid; gap: 18px; }
.form .row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 560px) { .form .row-2 { grid-template-columns: 1fr; } }
.field label { display: block; font-weight: 600; font-size: .98rem; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; font-size: 1.05rem; color: var(--ink);
  background: var(--paper); border: 1.5px solid var(--rule); border-radius: 10px; padding: 12px 14px;
}
.field textarea { min-height: 160px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.form-status { border-radius: 10px; padding: 12px 16px; font-size: 1rem; display: none; }
.form-status.ok { display: block; background: #e6f4ea; color: #1e5631; }
.form-status.err { display: block; background: #fdecea; color: #8a1c13; }
.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

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

.site-footer { background: var(--navy); color: var(--navy-ink-2); padding: 64px 0 28px; font-size: 1rem; }
.site-footer a { color: var(--navy-ink); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1.4fr; gap: 36px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer .brand-name { color: #fff; font-size: 1.8rem; }
.site-footer h3 { font-family: var(--sans); font-size: .8rem; letter-spacing: .14em; text-transform: uppercase; color: var(--highlight); margin-bottom: 1rem; font-weight: 600; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.site-footer ul a { text-decoration: none; }
.site-footer ul a:hover { text-decoration: underline; }
.footer-base { border-top: 1px solid rgba(255, 255, 255, .12); margin-top: 48px; padding-top: 22px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: .9rem; color: var(--footer-muted); }
.footer-base p { margin: 0; }

/* ---------- Warm touches: soft glow, photos that fade into the page ---------- */

.hero {
  background:
    radial-gradient(60% 70% at 85% 30%, var(--glow-1), transparent 70%),
    radial-gradient(50% 60% at 10% 90%, var(--glow-2), transparent 70%);
}


/* A wide photo that melts into the background on all sides */
.fade-photo {
  width: 100%; border-radius: var(--radius);
  -webkit-mask-image: radial-gradient(ellipse 75% 75% at 50% 50%, #000 55%, transparent 100%);
          mask-image: radial-gradient(ellipse 75% 75% at 50% 50%, #000 55%, transparent 100%);
}

/* A photo that melts away at the bottom, for sitting beside text */
.fade-bottom {
  -webkit-mask-image: linear-gradient(#000 65%, transparent);
          mask-image: linear-gradient(#000 65%, transparent);
}

/* Photo floated into the flow of the text */
.float-photo {
  float: right; width: min(46%, 250px); margin: .3rem 0 1rem 1.6rem;
  border-radius: 12px; box-shadow: var(--shadow); transform: rotate(1.5deg);
  border: 6px solid #fff;
}
.float-photo.left { float: left; margin: .3rem 1.6rem 1rem 0; transform: rotate(-1.5deg); }
.float-photo figcaption { font-size: .85rem; color: var(--ink-3); padding: 6px 2px 0; line-height: 1.35; }
.float-photo img { display: block; width: 100%; height: auto; border-radius: 6px; }
figure { margin: 0; }
.clearfix::after { content: ""; display: table; clear: both; }
@media (max-width: 560px) {
  .float-photo, .float-photo.left { float: none; width: 100%; margin: 1rem 0; transform: none; }
}

/* Polaroid-style scattered snapshots */
.snapshots { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px; margin-top: 32px; }
.snapshots a {
  display: block; background: #fff; padding: 8px 8px 10px; border-radius: 4px; box-shadow: var(--shadow);
  flex: 0 1 230px; min-width: 140px; transition: transform .25s ease;
}
.snapshots a:nth-child(odd) { transform: rotate(-2deg); }
.snapshots a:nth-child(even) { transform: rotate(2deg) translateY(10px); }
.snapshots a:hover { transform: rotate(0) scale(1.04); z-index: 2; }
.snapshots img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 2px; }

/* Gentle fade-in as sections scroll into view */
.js .reveal { opacity: 0; transform: translateY(18px); transition: opacity .8s ease, transform .8s ease; }
.js .reveal.in { opacity: 1; transform: none; }

/* ---------- Cookie policy (page, pop-up and first-visit notice) ---------- */

.policy { max-width: 44em; }
.policy h2 { font-size: clamp(1.4rem, 2.4vw, 1.75rem); margin-top: 2rem; }
.policy h2:first-child { margin-top: 0; }
.policy h3 { font-family: var(--sans); font-size: 1.1rem; font-weight: 600; margin: 1.4rem 0 .4rem; }

.policy-dialog {
  border: 0; padding: 0; border-radius: var(--radius); background: var(--card); color: var(--ink);
  width: min(720px, calc(100vw - 32px)); max-height: min(85vh, 900px);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .3);
}
.policy-dialog::backdrop { background: rgba(20, 28, 24, .55); }
.policy-dialog .pd-head {
  position: sticky; top: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--card); border-bottom: 1px solid var(--rule); padding: 16px 24px;
}
.policy-dialog .pd-head h2 { margin: 0; font-size: 1.4rem; }
.policy-dialog .pd-close {
  border: 1px solid var(--rule); background: var(--paper); border-radius: 999px; width: 40px; height: 40px;
  font-size: 1.4rem; line-height: 1; cursor: pointer; color: var(--ink);
}
.policy-dialog .pd-body { padding: 8px 24px 28px; font-size: 1.02rem; }
.policy-dialog .policy h2 { font-size: 1.3rem; }

.cookie-notice {
  position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 150; margin: 0 auto;
  max-width: 560px; background: var(--card); color: var(--ink);
  border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: 0 18px 50px rgba(0, 0, 0, .18);
  padding: 18px 20px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px;
  animation: notice-in .4s ease both;
}
.cookie-notice p { margin: 0; flex: 1 1 260px; font-size: .98rem; color: var(--ink-2); }
.cookie-notice p strong { color: var(--ink); }
.cookie-notice .cn-actions { display: flex; gap: 8px; }
.cookie-notice .btn { padding: 9px 16px; font-size: .95rem; }
@keyframes notice-in { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* ---------- Animations ---------- */

/* Groups (bookshelf, photo grids, link cards, lists) fade up one item after another */
.js .stagger > * {
  opacity: 0; translate: 0 22px;
  transition: opacity .6s ease, translate .7s cubic-bezier(.2, .8, .2, 1);
  transition-delay: calc(var(--i, 0) * 70ms);
}
.js .stagger.in > * { opacity: 1; translate: 0 0; }

/* Page-top entrance: text rises in line by line */
@keyframes rise { from { opacity: 0; translate: 0 24px; } to { opacity: 1; translate: 0 0; } }
.hero .split > div:first-child > *,
.page-head .wrap > * { animation: rise .8s cubic-bezier(.2, .8, .2, 1) both; }
.hero .split > div:first-child > :nth-child(2), .page-head .wrap > :nth-child(2) { animation-delay: .12s; }
.hero .split > div:first-child > :nth-child(3), .page-head .wrap > :nth-child(3) { animation-delay: .26s; }
.hero .split > div:first-child > :nth-child(4), .page-head .wrap > :nth-child(4) { animation-delay: .4s; }

/* Shirley's photo fades in; the book cover drops in, then floats gently */
@keyframes fade-zoom { from { opacity: 0; scale: .95; } to { opacity: 1; scale: 1; } }
@keyframes drop-in { from { opacity: 0; translate: -24px 36px; } to { opacity: 1; translate: 0 0; } }
@keyframes bob { 0%, 100% { translate: 0 0; } 50% { translate: 0 -9px; } }
.hero-art .portrait { animation: fade-zoom 1s .15s cubic-bezier(.2, .8, .2, 1) both; }
.hero-cover { animation: drop-in .9s .55s cubic-bezier(.2, .8, .2, 1) both, bob 6s 1.6s ease-in-out infinite; }

/* Small line that draws in before each section label */
.eyebrow::before {
  content: ""; display: inline-block; width: 22px; height: 2px; background: currentColor;
  vertical-align: middle; margin: -3px 10px 0 0; transform-origin: left center;
  transition: transform .8s .25s cubic-bezier(.2, .8, .2, 1);
}
.js .reveal:not(.in) .eyebrow::before { transform: scaleX(0); }
@keyframes line-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.hero .eyebrow::before, .page-head .eyebrow::before { animation: line-grow .8s .2s cubic-bezier(.2, .8, .2, 1) both; }

/* Book covers on the inner pages tilt like a book being picked up */
.book-cover { perspective: 800px; }
.book-cover img { transform-origin: left center; transition: transform .5s cubic-bezier(.2, .8, .2, 1), box-shadow .5s ease; }
.book-cover img:hover { transform: rotateY(-14deg) translateY(-4px); box-shadow: 12px 20px 34px rgba(25, 40, 30, .28); }

/* Featured covers and the musical poster lift slightly on hover */
.book-feature .cover-frame img, .poster { transition: transform .5s cubic-bezier(.2, .8, .2, 1); }
.book-feature .cover-frame img:hover, .poster:hover { transform: translateY(-6px) rotate(-1deg); }

/* Musical notes drifting up off the musical's book cover */
.poster-wrap { position: relative; width: min(300px, 80%); margin: 0 auto; }
#musical { overflow-x: clip; }   /* keeps the notes from widening the page on phones */
.poster-wrap .poster { width: 100%; position: relative; z-index: 1; }
/* Notes sit behind the cover (z-index 0) and rise up beside it and out over the top */
.notes { position: absolute; inset: -10% -30% 25% -30%; pointer-events: none; z-index: 0; overflow: visible; }
.notes span {
  position: absolute; bottom: 0; left: var(--x, 50%);
  font-size: var(--s, 1.6rem); line-height: 1; color: var(--highlight);
  text-shadow: 0 0 2px rgba(20, 30, 24, .85), 0 0 1px rgba(20, 30, 24, .9), 0 3px 12px rgba(0, 0, 0, .4);
  opacity: 0;
}
.js .notes.playing span { animation: note-float var(--d, 5s) ease-in var(--delay, 0s) infinite; }
@keyframes note-float {
  0%   { opacity: 0; transform: translate(0, 0) rotate(0deg) scale(.6); }
  12%  { opacity: .95; }
  50%  { transform: translate(var(--sway, 18px), -150px) rotate(var(--r, 12deg)) scale(1); }
  80%  { opacity: .7; }
  100% { opacity: 0; transform: translate(calc(var(--sway, 18px) * -0.6), -300px) rotate(calc(var(--r, 12deg) * -1)) scale(1.1); }
}
/* Each note gets its own position, size, speed, drift and start time.
   The cover spans roughly 19%–81% of this area: notes outside that rise beside it,
   notes inside it start hidden behind the book and appear over its top edge. */
.notes span:nth-child(1)  { --x: 4%;  --s: 1.7rem; --d: 5.2s; --delay: 0s;   --sway: -18px; --r: -14deg; }
.notes span:nth-child(2)  { --x: 11%; --s: 2.2rem; --d: 6.4s; --delay: 1.1s; --sway: 16px;  --r: 10deg; }
.notes span:nth-child(3)  { --x: 15%; --s: 1.4rem; --d: 4.8s; --delay: 2.6s; --sway: -14px; --r: -18deg; }
.notes span:nth-child(4)  { --x: 84%; --s: 2rem;   --d: 5.8s; --delay: .6s;  --sway: 20px;  --r: 16deg; }
.notes span:nth-child(5)  { --x: 89%; --s: 1.6rem; --d: 5s;   --delay: 3.1s; --sway: -16px; --r: -10deg; }
.notes span:nth-child(6)  { --x: 95%; --s: 2.4rem; --d: 6.8s; --delay: 1.8s; --sway: 22px;  --r: 12deg; }
.notes span:nth-child(7)  { --x: 30%; --s: 1.6rem; --d: 6s;   --delay: 4s;   --sway: -20px; --r: -20deg; }
.notes span:nth-child(8)  { --x: 50%; --s: 2rem;   --d: 6.6s; --delay: 2.2s; --sway: 18px;  --r: 18deg; }
.notes span:nth-child(9)  { --x: 68%; --s: 1.5rem; --d: 5.6s; --delay: 4.8s; --sway: 16px;  --r: 12deg; }
.notes span:nth-child(10) { --x: 7%;  --s: 1.9rem; --d: 6.2s; --delay: 5.2s; --sway: 14px;  --r: 15deg; }

/* Link card arrows nudge forward */
.link-card .go { display: inline-block; transition: translate .25s ease; }
.link-card:hover .go { translate: 6px 0; }

/* ---------- "As featured in" press card (Fiction page) ---------- */

.press-card {
  display: flex; align-items: center; gap: 26px; margin: 1.6rem 0;
  padding: 20px 24px; border-radius: var(--radius);
  background:
    radial-gradient(rgba(31, 42, 36, .06) 1px, transparent 1.4px) 0 0 / 14px 14px,
    var(--paper-2);
  border: 1px solid var(--rule);
}
.press-thumbs { position: relative; flex: none; width: 150px; height: 150px; display: block; }
.press-cover, .press-clip {
  position: absolute; background: #fff; box-shadow: var(--shadow);
  transition: rotate .35s cubic-bezier(.2, .8, .2, 1), translate .35s cubic-bezier(.2, .8, .2, 1);
}
.press-cover { width: 92px; left: 0; top: 4px; padding: 3px 3px 10px; rotate: -6deg; }
.press-clip  { width: 62px; right: 4px; top: 0; padding: 3px; rotate: 4deg; }
.press-thumbs:hover .press-cover { rotate: -9deg; translate: -4px 0; }
.press-thumbs:hover .press-clip  { rotate: 7deg; translate: 4px -3px; }
.press-text .eyebrow { margin-bottom: .3rem; }
.press-title { font-family: var(--serif); font-size: 1.35rem; line-height: 1.2; margin: 0; }
.press-meta { color: var(--ink-3); font-size: .95rem; margin: .2rem 0 .9rem; }
.press-text .btn { padding: 10px 18px; font-size: .95rem; }
@media (max-width: 560px) {
  .press-card { flex-direction: column; align-items: flex-start; gap: 14px; }
}

/* ---------- Links page: library index cards pinned to a board ---------- */

.links-board {
  overflow-x: clip;   /* stamps and tilted cards never widen the page on phones */
  background:
    radial-gradient(rgba(31, 42, 36, .06) 1px, transparent 1.4px) 0 0 / 18px 18px,
    var(--paper-2);
}
.lib-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 40px 30px; padding-top: 10px; }

.lib-card {
  --line: 30px;
  position: relative; display: flex; flex-direction: column;
  text-decoration: none; color: var(--ink);
  padding: 14px 26px 22px;
  border-radius: 3px;
  /* Index card: cream stock, red rule under the heading strip, faint blue-green lines */
  background:
    linear-gradient(transparent 59px, rgba(190, 70, 60, .45) 59px 61px, transparent 61px),
    repeating-linear-gradient(transparent 0 calc(var(--line) - 1px), rgba(47, 93, 74, .14) calc(var(--line) - 1px) var(--line)) 0 60px / 100% calc(100% - 60px) no-repeat,
    #fffdf5;
  box-shadow: 0 1px 2px rgba(25, 40, 30, .1), 0 14px 30px rgba(25, 40, 30, .13);
  rotate: var(--tilt, -1.2deg);
  transition: rotate .35s cubic-bezier(.2, .8, .2, 1), scale .35s cubic-bezier(.2, .8, .2, 1), box-shadow .35s ease;
}
.lib-card:nth-child(2n)   { --tilt: 1deg; }
.lib-card:nth-child(3n)   { --tilt: -.6deg; }
.lib-card:nth-child(4n)   { --tilt: 1.4deg; }

/* Drawing pin in the card's own colour */
.lib-card::before {
  content: ""; position: absolute; top: -9px; left: 50%; width: 18px; height: 18px; margin-left: -9px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, rgba(255, 255, 255, .7), transparent 45%), var(--tab);
  box-shadow: 0 3px 5px rgba(0, 0, 0, .3);
}
.lib-grid .lib-card:hover, .lib-grid .lib-card:focus-within {
  rotate: 0deg; scale: 1.025;
  box-shadow: 0 2px 4px rgba(25, 40, 30, .1), 0 24px 44px rgba(25, 40, 30, .2);
}

.lib-head { display: flex; align-items: center; gap: 12px; height: 46px; color: var(--tab); }
.lib-icon { width: 38px; height: 38px; flex: none; }
.lib-kind { font: 600 .74rem/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; }

/* Text sits on the card's ruled lines */
.lib-card h2 { font-size: 1.4rem; line-height: var(--line); margin: 0; padding-top: 0; }
.lib-card p { line-height: var(--line); margin: 0 0 var(--line); color: var(--ink-2); font-size: 1rem; flex: 1; }
.lib-card .go { line-height: var(--line); font-weight: 600; color: var(--tab); }
.lib-card p a { color: var(--tab); }

/* Rubber stamp that thumps on as the card appears */
.lib-stamp {
  position: absolute; top: 12px; right: 16px;
  border: 2px solid var(--tab); color: var(--tab); border-radius: 5px;
  padding: 4px 9px 3px; font: 700 .68rem/1.2 var(--sans); letter-spacing: .14em; text-transform: uppercase;
  rotate: -9deg; opacity: .8;
  background: rgba(255, 255, 255, .35);
}
@keyframes stamp-on { 0% { opacity: 0; scale: 1.6; } 60% { opacity: .9; scale: .94; } 100% { opacity: .8; scale: 1; } }
.js .lib-grid .lib-stamp { opacity: 0; }
.js .lib-grid.in .lib-stamp { animation: stamp-on .45s cubic-bezier(.3, 1.4, .5, 1) both; animation-delay: calc(var(--i, 0) * 120ms + .55s); }

/* Shop links on the "find Shirley's books" card */
.lib-shop { display: flex; flex-wrap: wrap; gap: 8px; }
.lib-shop a {
  display: inline-flex; align-items: center; padding: 8px 14px; border-radius: 999px;
  border: 1.5px solid var(--tab); color: var(--tab); font-weight: 600; font-size: .95rem; text-decoration: none;
  background: #fffdf5; transition: background-color .2s ease, color .2s ease;
}
.lib-shop a:hover { background: var(--tab); color: #fff; }

@media (max-width: 640px) {
  .lib-grid { grid-template-columns: 1fr; gap: 34px; }
  .lib-card { padding: 14px 20px 20px; --tilt: -.6deg; }
  .lib-card:nth-child(2n) { --tilt: .6deg; }
  .lib-stamp { right: 12px; font-size: .62rem; }
  .lib-shop a { flex: 1 1 auto; justify-content: center; padding: 11px 14px; }
}

/* ---------- Phones and small tablets ---------- */

.flyer-link { display: block; text-decoration: none; max-width: 720px; margin: 0 auto 56px; }
.flyer-link .flyer { margin: 0 auto; }
.tap-hint { display: none; }

@media (max-width: 640px) {
  body { font-size: 1.0625rem; }                       /* 17px: comfortable on a phone */
  .site-header .wrap { min-height: 64px; }
  .brand-name { font-size: 1.4rem; }
  .section { padding: 56px 0; }
  .section-head { margin-bottom: 24px; }

  /* Top of the homepage: name and title on separate lines, centred photo */
  .hero { padding: 28px 0 56px; }
  .hero h1 em { display: block; }
  .hero h1 .dash { display: none; }
  .hero .eyebrow { letter-spacing: .1em; font-size: .72rem; line-height: 1.6; }
  .hero-art { justify-self: center; width: min(280px, 72%); margin: 12px auto 0; }
  .hero-cover { left: -11%; width: 34%; }

  /* Buttons fill the width so they are easy to tap */
  .btn-row { flex-direction: column; align-items: stretch; }
  .btn-row .btn { justify-content: center; text-align: center; padding: 14px 20px; }

  /* Small photos keep their size instead of stretching blurry */
  .float-photo, .float-photo.left { width: auto; max-width: min(100%, 280px); margin: 1.2rem auto; float: none; display: table; transform: none; }

  /* Flyer: tap to open it full size */
  .flyer-link { margin-bottom: 40px; }
  .tap-hint { display: block; text-align: center; font-size: .85rem; color: var(--ink-3); margin-top: 8px; }

  /* Event dates sit above their text instead of squeezing it */
  .timeline li { grid-template-columns: 1fr; gap: 2px; padding: 16px 0; }
  .timeline .when { font-size: 1.05rem; }

  /* Book page jump-links: one swipeable row */
  .toc {
    flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x proximity;
    margin-left: calc(var(--gutter) * -1); margin-right: calc(var(--gutter) * -1);
    padding: 2px var(--gutter) 8px; scrollbar-width: none;
  }
  .toc::-webkit-scrollbar { display: none; }
  .toc li { flex: 0 0 auto; scroll-snap-align: start; }
  .toc a { padding: 9px 14px; white-space: nowrap; }

  /* Book pages: cover above the text, a comfortable size */
  .book { gap: 18px; padding: 40px 0; }
  .book-cover img { max-width: 160px; }
  .book h2 { font-size: 1.6rem; }

  /* Bookshelf: two neat columns */
  .shelf { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px 16px; }

  /* Launch photo snapshots: two per row, less tilt */
  .snapshots { gap: 12px; }
  .snapshots a { flex: 0 1 calc(50% - 6px); min-width: 0; }
  .snapshots a:nth-child(odd) { transform: rotate(-1deg); }
  .snapshots a:nth-child(even) { transform: rotate(1deg) translateY(6px); }

  /* Call-to-action box stacks neatly */
  .callout { flex-direction: column; align-items: stretch; text-align: left; }
  .callout .btn { justify-content: center; }

  /* Footer links big enough to tap */
  .site-footer { padding-top: 48px; }
  .site-footer ul { gap: 0; }
  .site-footer ul a { display: inline-block; padding: 9px 0; }
  .footer-base { flex-direction: column; }

  /* Cookie notice compact at the bottom */
  .cookie-notice { left: 10px; right: 10px; bottom: 10px; padding: 14px 16px; }
  .cookie-notice .cn-actions { width: 100%; }
  .cookie-notice .cn-actions .btn { flex: 1; justify-content: center; }

  /* Cookie policy pop-up uses the whole screen */
  .policy-dialog { width: calc(100vw - 16px); max-height: 92vh; }
  .policy-dialog .pd-head, .policy-dialog .pd-body { padding-left: 18px; padding-right: 18px; }
}

/* On touch screens, hover effects can get stuck after a tap, so switch them off */
@media (hover: none) {
  .shelf a:hover img, .book-cover img:hover, .book-feature .cover-frame img:hover,
  .poster:hover, .photo-grid a:hover img, .link-card:hover, .btn:hover { transform: none; }
  .snapshots a:hover { transform: none; }
}

/* ---------- Motion ---------- */

/* Animations play on every device, including those with "reduce motion" turned on
   (the site owner's choice). Only the jump-to-section scrolling is made instant there. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
