/* =====================================================================
   THE REGENCY CANVAS: every page except the homepage.
   help.html, refunds.html, terms.html, privacy-policy.html and the PHP
   pages rendered through _private/page.php (thanks, download, sample,
   errors, the paused link, admin).

   Built on the homepage tokens (home.css), not an import of it. Same
   identity: parchment, antique gold, dusty rose script, plum ink, gilded
   frames. Mobile first; desktop from 820px. 19px base on phones, 20px on
   desktop, 48px+ tap targets, AA contrast.
   ===================================================================== */
:root {
  --parch: #f4ead6;
  --ivory: #fbf6ec;
  --paper: #fffcf5;
  --ink: #2b1822;
  --sepia: #4f3b2f;
  --soft: #4f3b2f;
  --plum: #4a1a2e;
  --plum-2: #63253e;
  --gold: #a8843f;
  --gold-d: #7a5a1e;
  --gold-l: #dcc28a;
  --rose: #e3a1a4;
  --rose-d: #a04b55;
  --line: #dcc9a3;
  --serif-d: "Cormorant Garamond", "Cormorant", Garamond, Georgia, serif;
  --serif: "Source Serif 4", "Source Serif Pro", Georgia, "Times New Roman", serif;
  --script: "Pinyon Script", "Snell Roundhand", cursive;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --ornament: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 150 14'%3E%3Cpath d='M0 7h60M90 7h60' stroke='%23a8843f' stroke-width='1'/%3E%3Cpath d='M75 1l6 6-6 6-6-6z' fill='none' stroke='%23a8843f' stroke-width='1.2'/%3E%3Ccircle cx='64' cy='7' r='1.6' fill='%23a8843f'/%3E%3Ccircle cx='86' cy='7' r='1.6' fill='%23a8843f'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
html { font-size: 19px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--parch); color: var(--ink);
  font-family: var(--serif); line-height: 1.6; overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--plum-2); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--rose-d); }
:focus-visible { outline: 3px solid #b07f22; outline-offset: 3px; }
h1, h2, h3 { font-family: var(--serif-d); color: var(--plum); font-weight: 600; line-height: 1.12; letter-spacing: -.005em; font-variant-numeric: lining-nums; }
p { margin: 0 0 1em; }
strong { font-weight: 700; }
.wrap { max-width: 1140px; margin: 0 auto; padding: 0 16px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -80px; z-index: 2000; background: var(--plum); color: #fff; padding: 12px 18px; border-radius: 8px; }
.skip:focus { top: 8px; color: #fff; }
.script-accent { font-family: var(--script); color: var(--rose-d); font-size: 2.1rem; line-height: 1; margin: 0 0 .1em; }

/* ============================ HEADER ============================ */
.masthead { background: var(--ivory); border-bottom: 1px solid var(--line); position: relative; z-index: 50; }
.masthead::after { content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 3px; pointer-events: none;
  border-bottom: 1px solid rgba(168, 132, 63, .45); }
.mast-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 12px; padding-top: 6px; }
.brand { display: inline-flex; align-items: center; min-height: 48px; font-family: var(--serif-d); font-weight: 700; font-size: 1.35rem; color: var(--plum); text-decoration: none; letter-spacing: .01em; white-space: nowrap; }
.brand:hover { color: var(--plum); }
.brand-the { font-family: var(--script); font-weight: 400; color: var(--rose-d); font-size: 1.35em; margin-right: .12em; }
.secnav { width: 100%; display: flex; justify-content: space-between; gap: 4px; border-top: 1px solid var(--line); margin-top: 4px; }
.secnav a { position: relative; display: inline-flex; align-items: center; min-height: 48px; padding: 0 2px; font-size: .8rem; font-weight: 600; color: var(--plum); text-decoration: none; white-space: nowrap; }
.secnav a[aria-current="page"] { color: var(--rose-d); }
.secnav a::after { content: ""; position: absolute; left: 2px; right: 2px; bottom: 9px; height: 2px; background: var(--gold); transform: scaleX(0); transform-origin: 0 50%; transition: transform .25s ease; }
.secnav a:hover::after, .secnav a[aria-current="page"]::after { transform: scaleX(1); }
@media (max-width: 359px) { .secnav { flex-wrap: wrap; justify-content: center; gap: 0 14px; } }

/* ============================ PAGE BODY ============================ */
main { display: block; flex: 1 0 auto; width: 100%; max-width: 900px; margin: 0 auto; padding: 26px 16px 60px; }
.sheet { position: relative; min-width: 0; overflow-wrap: break-word; padding: 26px 18px 28px; background: var(--paper); border: 1px solid var(--gold);
  box-shadow: 0 0 0 5px var(--paper), 0 0 0 6px var(--gold-l), 0 24px 50px rgba(74, 26, 46, .12); }
.kicker { margin: 0 0 .5em; color: var(--gold-d); font-weight: 700; font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; }
.sheet h1 { font-size: clamp(2.05rem, 7.6vw, 3rem); line-height: 1.06; margin: 0 0 .5em; }
.sheet h1::after { content: ""; display: block; width: 150px; height: 14px; margin: 16px 0 0; background: var(--ornament) left center / contain no-repeat; }
.sheet h2 { font-size: clamp(1.6rem, 5.4vw, 2.05rem); margin: 1.5em 0 .45em; }
.sheet h3 { font-size: 1.45rem; margin: 1.3em 0 .4em; }
.lead { font-size: 1.08rem; color: var(--sepia); }
.sheet ul, .sheet ol { padding-left: 1.4em; margin: 0 0 1.1em; }
.sheet li { margin-bottom: .55em; padding-left: .2em; }
.sheet ul li::marker { color: var(--gold-d); }
.sheet ol li::marker { color: var(--gold-d); font-family: var(--serif-d); font-weight: 700; font-size: 1.1em; }
.updated { font-size: .9rem; color: var(--sepia); margin-top: 2em; padding-top: 1em; border-top: 1px solid var(--line); }

/* notices (the "which file" helper, save-your-files, admin messages) */
.callout { margin: 1.3em 0; padding: 16px 18px; background: #fbf1e3; border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: 0 10px 10px 0; color: var(--ink); }
.callout strong:first-child { color: var(--plum); }
.chooser { position: relative; padding: 20px 18px 18px; background: var(--ivory); border: 1px solid var(--gold); border-radius: 10px;
  box-shadow: 0 0 0 4px var(--ivory), 0 0 0 5px var(--gold-l); margin: 1.6em 0; }
.chooser > strong:first-child { display: block; font-family: var(--serif-d); font-size: 1.5rem; line-height: 1.15; margin-bottom: .35em; }

/* ============================ BUTTONS ============================ */
.btn {
  position: relative; overflow: hidden; isolation: isolate;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; vertical-align: middle;
  min-height: 56px; padding: 14px 26px; border: 0; border-radius: 10px; cursor: pointer;
  background: var(--plum); color: #fff8ec; text-decoration: none; text-align: center;
  font-family: var(--serif); font-weight: 600; font-size: 1.05rem; line-height: 1.25;
  box-shadow: inset 0 0 0 1px rgba(220, 194, 138, .75), inset 0 0 0 4px var(--plum), inset 0 0 0 5px rgba(220, 194, 138, .45), 0 10px 22px rgba(74, 26, 46, .24);
  transition: transform .15s ease, background-color .2s ease, box-shadow .2s ease;
}
.btn:hover { background: var(--plum-2); color: #fff; transform: translateY(-1px);
  box-shadow: inset 0 0 0 1px rgba(220, 194, 138, .85), inset 0 0 0 4px var(--plum-2), inset 0 0 0 5px rgba(220, 194, 138, .5), 0 14px 28px rgba(74, 26, 46, .3); }
.btn[disabled] { opacity: .65; cursor: wait; }
.btn-shine::after {
  content: ""; position: absolute; z-index: -1; top: 0; left: -130%; width: 55%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 236, 196, .42), transparent);
  transform: skewX(-20deg); animation: shine 3.6s ease-in-out infinite;
}
@keyframes shine { 0% { left: -130%; } 55% { left: 150%; } 100% { left: 150%; } }

/* ============================ BUYER PAGES ============================ */
.covers { display: flex; justify-content: center; align-items: flex-end; gap: 12px; margin: 26px 0 14px; padding: 0 6px 10px; }
.covers img { flex: 0 1 140px; min-width: 0; width: 140px; border-radius: 2px 5px 5px 2px;
  box-shadow: 1px 0 0 #f1ead9, 2px 0 0 #cfc6b0, 3px 1px 0 #f1ead9, 4px 1px 0 #cfc6b0, 10px 14px 22px rgba(43, 24, 34, .3), 2px 4px 8px rgba(43, 24, 34, .18); }
.covers img:only-child { flex-basis: 180px; width: 180px; }

.files { list-style: none; margin: 10px 0 8px; padding: 0 !important; display: grid; gap: 12px; }
.files li { margin: 0; }
.file, .files li.file { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; padding: 16px; background: #fff;
  border: 1px solid var(--line); border-left: 4px solid var(--gold); border-radius: 0 10px 10px 0; box-shadow: 0 6px 16px rgba(74, 26, 46, .06); }
.file .what { flex: 1 1 240px; min-width: 0; }
.file strong { display: block; font-family: var(--serif-d); font-size: 1.4rem; font-weight: 700; line-height: 1.15; color: var(--plum); }
.file span { display: block; font-size: .92rem; color: var(--sepia); }
.file .btn { flex: 1 1 100%; min-height: 60px; font-size: 1.12rem; }
.file .btn::before { content: ""; width: 22px; height: 22px; flex: 0 0 auto; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4v11M7 10l5 5 5-5M5 20h14'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4v11M7 10l5 5 5-5M5 20h14'/%3E%3C/svg%3E") center / contain no-repeat; }
.used { display: block; flex: 1 1 100%; text-align: center; padding: 12px; border: 1px dashed var(--line); border-radius: 10px; font-size: .95rem; color: var(--sepia); font-weight: 700; }

.steps { list-style: none; margin: 14px 0 18px; padding: 0 !important; display: grid; gap: 16px; }
.steps li { position: relative; margin: 0; padding: 6px 0 0 62px !important; min-height: 52px; }
.steps .n { position: absolute; left: 0; top: 0; width: 46px; height: 54px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-family: var(--serif-d); font-weight: 700; font-size: 1.6rem; color: var(--plum); background: var(--paper);
  border: 1.5px solid var(--gold); outline: 1px solid var(--gold-l); outline-offset: 3px; font-variant-numeric: lining-nums; }

/* ============================ FORMS / ADMIN ============================ */
input[type=email], input[type=text], input[type=search], textarea { font: inherit; font-size: 1rem; min-height: 52px; color: var(--ink); }
.sheet table { width: 100%; border-collapse: collapse; background: #fff; font-size: .85rem; }
.sheet th, .sheet td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.sheet th { background: var(--ivory); color: var(--plum); font-weight: 700; }
.sheet form .btn { min-height: 52px; }
.sheet button:not(.btn) { font: inherit; font-size: .85rem; font-weight: 600; min-height: 44px; padding: 8px 14px; cursor: pointer;
  color: var(--plum); background: var(--ivory); border: 1.5px solid var(--gold); border-radius: 8px; }
.sheet button:not(.btn):hover { background: #f3e6cc; }

/* ============================ FOOTER ============================ */
footer.site { background: var(--ink); color: #eadfcd; padding: 34px 0 30px; font-size: .9rem; border-top: 3px double var(--gold-l); }
footer.site a { color: #f3e2bf; display: inline-flex; align-items: center; min-height: 44px; }
footer.site a:hover { color: #fff; }
footer.site nav { display: flex; flex-wrap: wrap; gap: 0 22px; margin-bottom: 12px; }
footer.site p { margin: 0 0 .5em; }
footer.site .em a { display: inline; min-height: 0; }

/* ============================ WIDER PHONES ============================ */
@media (min-width: 560px) {
  .sheet { padding: 34px 32px 36px; }
  .file .btn { flex: 0 0 auto; min-width: 200px; }
  .used { flex: 0 0 auto; }
  .covers { gap: 18px; }
}

/* ============================ DESKTOP ============================ */
@media (min-width: 820px) {
  html { font-size: 20px; }
  .masthead { position: sticky; top: 0; background: rgba(251, 246, 236, .96); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
  .mast-row { flex-wrap: nowrap; min-height: 66px; padding-top: 0; }
  .secnav { width: auto; border-top: 0; margin-top: 0; gap: 4px; }
  .secnav a { padding: 0 11px; font-size: .86rem; }
  .secnav a::after { left: 11px; right: 11px; bottom: 8px; }
  main { padding: 48px 24px 84px; }
  .sheet { padding: 52px 60px 56px; }
  .kicker { font-size: .78rem; }
  .steps li { padding-left: 70px !important; }
}

/* ============================ REDUCED MOTION ============================ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

@media print {
  .masthead .secnav, footer.site nav, .skip { display: none !important; }
  body { background: #fff; }
  .sheet { box-shadow: none; border: 0; padding: 0; }
}

/* ---- Sticky header on every size, back link, back-to-top (2026-10-13) ---- */
.masthead { position: sticky; top: 0; background: rgba(251, 246, 236, .97); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.back-row { max-width: 860px; margin: 18px auto 16px; padding: 0 16px; position: relative; z-index: 2; }
.back-link { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 8px 18px 8px 12px; border-radius: 999px;
  background: var(--paper, #fffcf5); color: var(--plum, #4a1a2e); border: 1.5px solid var(--gold, #b08a46); font-weight: 600; text-decoration: none;
  box-shadow: 0 4px 12px rgba(74, 26, 46, .10); }
.back-link:hover, .back-link:focus-visible { background: var(--plum, #4a1a2e); color: #fff; }
.back-link svg { width: 22px; height: 22px; flex: 0 0 auto; }
.to-top { position: fixed; right: 14px; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 79; width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer; background: var(--paper, #fffcf5); color: var(--plum, #4a1a2e); border: 1.5px solid var(--gold, #b08a46);
  box-shadow: 0 8px 20px rgba(74, 26, 46, .22); opacity: 0; visibility: hidden; transform: translateY(10px); transition: opacity .25s, transform .25s, visibility .25s; }
.to-top.show { opacity: 1; visibility: visible; transform: none; }
.to-top svg { width: 24px; height: 24px; }
@media (prefers-reduced-motion: reduce) { .to-top { transition: none; } }
@media print { .to-top, .back-row { display: none !important; } }

/* Audiobook section on the download page (added 2026-10-15) */
.audio-head { margin: 1.6rem 0 .2rem; font-size: 1.15rem; color: #5e1f2e; }
.audio-note { margin: 0 0 .6rem; color: #6b5d50; }
