/* Senior eBooks: one stylesheet for the hub and every shelf.
   A shelf changes its look only through the variables below
   (set from "theme" in shelves/<id>/shelf.json by build.py). */

@font-face { font-family: "Atkinson Hyperlegible"; src: url("fonts/AtkinsonHyperlegible-Regular.ttf") format("truetype"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Atkinson Hyperlegible"; src: url("fonts/AtkinsonHyperlegible-Bold.ttf") format("truetype"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Fraunces"; src: url("fonts/Fraunces-var.ttf") format("truetype"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Caveat"; src: url("fonts/caveat-var.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }

:root {
  --paper: #FFF7EA;      /* page */
  --paper2: #FCE9D0;     /* soft bands */
  --card: #FFFFFF;
  --ink: #2A2342;        /* text: plum ink, 14:1 on paper */
  --muted: #5A5170;
  --brand: #8E3557;      /* berry: buttons, links */
  --brandInk: #FFFFFF;
  --accent: #E98A6B;     /* blush coral */
  --accentDeep: #A8452A;
  --sun: #F4B942;        /* honey */
  --sage: #5F8B71;
  --headingFont: "Fraunces";
  --handFont: "Caveat";
  --radius: 22px;
  --shadow: 0 2px 0 rgba(42, 35, 66, .06), 0 14px 34px -18px rgba(42, 35, 66, .35);
  --scale: 1;            /* the "Bigger text" button sets 1.18 */
}

*, *::before, *::after { box-sizing: border-box; }
html { font-size: calc(20px * var(--scale)); -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (max-width: 560px) { html { font-size: calc(19px * var(--scale)); } }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font-family: "Atkinson Hyperlegible", Verdana, Arial, sans-serif;
  line-height: 1.6;
}
img { max-width: 100%; display: block; }
a { color: var(--brand); text-underline-offset: .18em; text-decoration-thickness: .08em; }
a:focus-visible, button:focus-visible { outline: 4px solid var(--sun); outline-offset: 3px; border-radius: 8px; }
h1, h2, h3 {
  font-family: var(--headingFont), Georgia, serif; font-weight: 650; line-height: 1.15;
  font-variation-settings: "SOFT" 100, "WONK" 0; letter-spacing: -.01em; margin: 0 0 .5em; color: var(--brand);
}
h1 { font-size: clamp(2.1rem, 5.4vw, 3.4rem); }
h2 { font-size: clamp(1.6rem, 3.6vw, 2.3rem); }
h3 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
.wrap { width: min(1120px, 100% - 2.4rem); margin-inline: auto; }
.hand { font-family: var(--handFont), cursive; font-weight: 600; color: var(--accentDeep); font-size: 1.7rem; line-height: 1.1; }
.lead { font-size: 1.15rem; color: var(--ink); max-width: 36em; }
.muted { color: var(--muted); }
.center { text-align: center; }
.center .lead { margin-inline: auto; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: 1rem; background: var(--card); padding: .6rem 1rem; z-index: 9; }

/* ---------- header ---------- */
.top { padding: 1rem 0; }
.top .wrap { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); margin-right: auto; }
.logo svg { width: 3rem; height: 3rem; flex: none; }
.logo b { font-family: var(--headingFont), Georgia, serif; font-variation-settings: "SOFT" 100; font-weight: 700; font-size: 1.45rem; color: var(--brand); line-height: 1; display: block; }
.logo small { display: block; font-size: .8rem; color: var(--muted); margin-top: .2rem; }
.tool { font: inherit; font-size: .9rem; font-weight: 700; background: var(--card); color: var(--ink); border: 2px solid rgba(42,35,66,.18); border-radius: 999px; padding: .45rem 1rem; cursor: pointer; text-decoration: none; min-height: 48px; display: inline-flex; align-items: center; gap: .4rem; }
.tool:hover { border-color: var(--brand); }
.tool[aria-pressed="true"] { background: var(--brand); color: var(--brandInk); border-color: var(--brand); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 60px; padding: .8rem 1.6rem; border-radius: 999px; font-weight: 700; font-size: 1.1rem; text-decoration: none; border: 3px solid var(--brand); background: var(--brand); color: var(--brandInk); box-shadow: 0 4px 0 rgba(0,0,0,.18); transition: transform .12s; cursor: pointer; }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(1px); box-shadow: 0 2px 0 rgba(0,0,0,.18); }
.btn.ghost { background: transparent; color: var(--brand); box-shadow: none; }
.btn.soon { background: var(--paper2); color: var(--ink); border-color: rgba(0,0,0,.12); box-shadow: none; cursor: default; }
.btn.soon:hover { transform: none; }
.btns { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.4rem; }

/* ---------- sections ---------- */
section { padding: clamp(2.6rem, 6vw, 4.6rem) 0; }
.band { background: var(--paper2); }
.band-brand { background: var(--brand); color: var(--brandInk); }
.band-brand h2, .band-brand a { color: var(--brandInk); }
.eyebrow { font-size: .85rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--accentDeep); margin-bottom: .6rem; }

/* hero */
.hero .wrap { display: grid; grid-template-columns: 1.1fr .9fr; gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center; }
.hero-art { position: relative; }
.hero-art img, .hero-art svg { width: 100%; height: auto; }
@media (max-width: 820px) { .hero .wrap { grid-template-columns: 1fr; } .hero-art { max-width: 460px; margin-inline: auto; order: -1; } }

/* watercolor art fades into the page instead of showing a square edge */
img.soft { -webkit-mask-image: radial-gradient(closest-side, #000 78%, transparent 100%); mask-image: radial-gradient(closest-side, #000 78%, transparent 100%); }

/* features */
.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.2rem; margin-top: 2rem; }
@media (max-width: 980px) { .features { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .features { grid-template-columns: 1fr; } }
.feature { background: var(--card); border-radius: var(--radius); padding: 1.4rem; box-shadow: var(--shadow); }
.feature .ico { width: 3.4rem; height: 3.4rem; border-radius: 50%; display: grid; place-items: center; margin-bottom: .8rem; background: var(--paper2); }
.feature .ico svg { width: 2rem; height: 2rem; }
.feature h3 { margin-bottom: .3rem; }
.feature p { margin: 0; color: var(--muted); }

/* shelves (hub) */
.shelves { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; margin-top: 2rem; }
@media (max-width: 980px) { .shelves { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .shelves { grid-template-columns: 1fr; } }
.shelf { background: var(--card); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; text-decoration: none; color: var(--ink); border: 3px solid transparent; transition: transform .15s, border-color .15s; }
a.shelf:hover { transform: translateY(-4px); border-color: var(--s-brand); }
.shelf .shelf-top { background: var(--s-paper); padding: 1.2rem 1.2rem 0; display: flex; align-items: flex-end; justify-content: center; min-height: 230px; position: relative; }
.shelf .shelf-top img { width: 86%; max-width: 270px; aspect-ratio: 1; object-fit: cover; margin-bottom: -1.2rem; }
.shelf .shelf-top { overflow: hidden; }
.shelf .shelf-body { padding: 1.2rem 1.4rem 1.5rem; display: flex; flex-direction: column; gap: .4rem; flex: 1; }
.shelf h3 { color: var(--s-brand); font-size: 1.45rem; margin: 0; }
.shelf .s-tag { font-family: var(--handFont), cursive; font-size: 1.45rem; color: var(--s-accent); line-height: 1.1; }
.shelf .s-go { margin-top: auto; padding-top: .6rem; font-weight: 700; color: var(--s-brand); }
.shelf .s-url { font-size: .85rem; color: var(--muted); word-break: break-all; }
.shelf.soon { border: 3px dashed rgba(42,35,66,.22); background: transparent; box-shadow: none; align-items: center; justify-content: center; text-align: center; padding: 2rem; min-height: 320px; }
.shelf.soon svg { width: 4rem; height: 4rem; margin: 0 auto .6rem; }

/* steps */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.4rem; counter-reset: s; margin-top: 2rem; }
@media (max-width: 820px) { .steps { grid-template-columns: 1fr; } }
.step { background: var(--card); border-radius: var(--radius); padding: 1.4rem 1.4rem 1.4rem 5rem; position: relative; box-shadow: var(--shadow); }
.step::before { counter-increment: s; content: counter(s); position: absolute; left: 1.2rem; top: 1.2rem; width: 2.8rem; height: 2.8rem; border-radius: 50%; background: var(--brand); color: var(--brandInk); font-weight: 700; font-size: 1.3rem; display: grid; place-items: center; }
.step h3 { margin-bottom: .2rem; }
.step p { margin: 0; color: var(--muted); }

/* FAQ */
.faq { max-width: 46rem; margin: 2rem auto 0; display: grid; gap: .8rem; }
.faq details { background: var(--card); border-radius: 18px; box-shadow: var(--shadow); }
.faq summary { cursor: pointer; padding: 1.1rem 1.3rem; font-weight: 700; font-size: 1.1rem; list-style: none; display: flex; justify-content: space-between; gap: 1rem; min-height: 60px; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.6rem; line-height: 1; color: var(--brand); }
.faq details[open] summary::after { content: "–"; }
.faq details p { padding: 0 1.3rem 1.1rem; margin: 0; }

/* contact */
.contact { text-align: center; }
.contact .mail { font-family: var(--headingFont), Georgia, serif; font-variation-settings: "SOFT" 100; font-weight: 650; font-size: clamp(1.45rem, 5vw, 2.4rem); color: var(--brandInk); word-break: break-word; }
.contact .btns { justify-content: center; }
.band-brand .btn { background: var(--brandInk); color: var(--brand); border-color: var(--brandInk); }
.band-brand .btn.ghost { background: transparent; color: var(--brandInk); }

/* footer */
footer { padding: 2rem 0 2.6rem; font-size: .9rem; color: var(--muted); }
footer .wrap { display: flex; flex-wrap: wrap; gap: .6rem 1.6rem; justify-content: space-between; }
footer a { color: var(--ink); }

/* ---------- shelf page: book ---------- */
.book .wrap { display: grid; grid-template-columns: 1fr 1.15fr; gap: clamp(1.6rem, 4vw, 3.5rem); align-items: center; }
@media (max-width: 820px) { .book .wrap { grid-template-columns: 1fr; } }
.cover { border-radius: 6px 14px 14px 6px; box-shadow: -6px 0 0 rgba(0,0,0,.08) inset, 0 24px 50px -22px rgba(0,0,0,.55), 0 2px 6px rgba(0,0,0,.12); transform: rotate(-1.5deg); max-width: 480px; margin-inline: auto; width: 100%; }
.facts { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0 1.2rem; padding: 0; list-style: none; }
.facts li { background: var(--card); border: 2px solid rgba(0,0,0,.08); border-radius: 999px; padding: .35rem .95rem; font-weight: 700; font-size: .95rem; }
.price { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.4rem; background: var(--card); border-radius: var(--radius); padding: 1.2rem 1.4rem; box-shadow: var(--shadow); margin-top: 1.4rem; }
.price .amount { font-family: var(--headingFont), Georgia, serif; font-size: 2rem; font-weight: 700; color: var(--brand); }
.price .amount .was { font-size: 1.3rem; font-weight: 400; color: var(--ink); opacity: .6; margin-right: .3rem; }
.price .note { font-size: .92rem; color: var(--muted); flex-basis: 100%; margin: 0; }
.chapters { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1.6rem; margin: 2rem 0 0; padding: 0; list-style: none; counter-reset: c; }
.chapters li { position: relative; background: #fff; border-radius: 18px; overflow: hidden; box-shadow: 0 10px 26px rgba(60,40,10,.10); }
.chapters img { display: block; width: 100%; height: auto; aspect-ratio: 5 / 4; object-fit: cover; background: var(--paper2); }
.chapters li::before { counter-increment: c; content: counter(c); position: absolute; top: .8rem; left: .8rem; width: 2.6rem; height: 2.6rem; border-radius: 50%; background: var(--brand); color: var(--brandInk); display: grid; place-items: center; font-weight: 700; font-size: 1.1rem; box-shadow: 0 2px 8px rgba(0,0,0,.18); }
.chapters li > div { padding: 1rem 1.2rem 1.3rem; }
.chapters b { display: block; font-family: var(--headingFont), Georgia, serif; font-size: 1.25rem; line-height: 1.25; color: var(--brand); margin-bottom: .3rem; }
.chapters span { color: var(--muted); font-size: .95rem; }
.how { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-top: 1.6rem; }
@media (max-width: 900px) { .how { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .how { grid-template-columns: 1fr; } }
.how div { background: var(--card); border-radius: 18px; padding: 1.1rem 1.2rem; border-top: 6px solid var(--sun); box-shadow: var(--shadow); }
.how b { display: block; color: var(--brand); font-size: 1.1rem; margin-bottom: .2rem; }
.how span { color: var(--muted); font-size: .95rem; }
.pages { display: flex; gap: 1.2rem; overflow-x: auto; padding: 1.2rem .4rem 1.6rem; scroll-snap-type: x mandatory; margin-top: 1rem; }
.pages figure { margin: 0; flex: 0 0 min(300px, 78%); scroll-snap-align: start; }
.pages img { height: auto; border-radius: 6px; box-shadow: 0 16px 34px -20px rgba(0,0,0,.6), 0 1px 4px rgba(0,0,0,.15); background: #fff; }
.pages figcaption { font-size: .9rem; color: var(--muted); margin-top: .6rem; text-align: center; }
.trust { list-style: none; padding: 0; margin: 1.4rem 0 0; display: grid; gap: .8rem; max-width: 46rem; }
.trust li { display: grid; grid-template-columns: 2.2rem 1fr; gap: .8rem; align-items: start; }
.trust li::before { content: "✓"; width: 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--sage); color: #fff; display: grid; place-items: center; font-weight: 700; }
.letter { background: var(--card); border-radius: 6px; padding: clamp(1.4rem, 4vw, 2.6rem); box-shadow: var(--shadow); max-width: 44rem; margin-inline: auto; position: relative;
  background-image: repeating-linear-gradient(transparent 0 2.05rem, rgba(12,78,74,.10) 2.05rem calc(2.05rem + 1px)); line-height: 2.05rem; }
.letter .sign { font-family: var(--handFont), cursive; font-size: 2rem; color: var(--brand); margin: 0; }

/* little shelf mark (initials in a circle with one dot) */
.mark { width: 3rem; height: 3rem; border-radius: 50%; background: var(--brand); color: var(--brandInk); font-family: var(--headingFont), Georgia, serif; font-weight: 700; font-size: 1.15rem; display: grid; place-items: center; position: relative; flex: none; letter-spacing: .02em; }
.mark::after { content: ""; position: absolute; width: .55rem; height: .55rem; border-radius: 50%; background: var(--accent); right: .2rem; top: .35rem; }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
