/* Consistency Is Key: one fixed book stage. The actual PDF pages stay on this stage
   from the closed cover through every page turn. Layout numbers (--leaf-w, --leaf-h,
   --unfold) are set by pdf-book.js. */
@font-face{font-family:Lato;src:url('assets/fonts/Lato-Regular.ttf');font-display:swap}
@font-face{font-family:Lato;src:url('assets/fonts/Lato-Bold.ttf');font-weight:700;font-display:swap}
:root{
 --ink:#18272d;--cream:#f5efe3;--cream-deep:#ebe3d3;--muted:#58686c;--teal:#12667a;--orange:#ff932d;--rust:#945016;--rule:#20364026;
 --nav-h:64px;--folio-h:52px;--margin-w:min(300px,48vw);
 --leaf-w:300px;--leaf-h:466px;--unfold:0;
}
*{box-sizing:border-box}
html{scroll-behavior:auto;overflow-anchor:none}
.preview-note{font-size:12px;color:var(--muted);margin:8px 0 0;pointer-events:none;letter-spacing:.02em}
body{margin:0;color:var(--ink);background:var(--cream);font:16px/1.55 Lato,sans-serif;-webkit-font-smoothing:antialiased}
a{color:var(--teal);text-underline-offset:4px}
button,select,input,output{font:inherit;color:inherit}
button,a,select,input{-webkit-tap-highlight-color:transparent}
button,select{cursor:pointer}
button:disabled{opacity:.4;cursor:default}
:focus-visible{outline:3px solid var(--teal);outline-offset:3px}
[hidden]{display:none!important}
h1,h2,h3,p{margin-top:0}
h1,h2,h3{font-family:"Iowan Old Style",Georgia,serif;line-height:1.12;font-weight:500}
.eyebrow{font-size:11px;letter-spacing:.16em;text-transform:uppercase;color:var(--rust);margin:0 0 8px}
.visually-hidden{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.link-button{border:0;background:none;padding:0;color:var(--teal);text-decoration:underline;text-underline-offset:4px;font:inherit;cursor:pointer}

/* Site header stays; the stage takes the rest of the viewport. */
.book-nav{position:sticky;top:0;z-index:40;height:var(--nav-h);padding:0 32px;display:flex;align-items:center;justify-content:space-between;border-bottom:1px solid var(--rule);background:var(--cream)}
.book-nav a{text-decoration:none;font-weight:700;font-size:14px}
.book-nav>a{color:var(--ink)}
.book-nav nav{display:flex;gap:24px}

/* Runway: document scroll. Its height is set by JS: opening segment + one step per turn. */
.runway{position:relative;min-height:120svh}
.stage{position:sticky;top:var(--nav-h);height:calc(100svh - var(--nav-h));overflow:hidden;display:grid;grid-template-columns:minmax(0,1fr) var(--margin-w);grid-template-rows:minmax(0,1fr) var(--folio-h);background:var(--cream)}
.stage[data-notes="closed"]{grid-template-columns:minmax(0,1fr) 0}
.stage[data-notes="closed"] .margin{display:none}

/* Title overlay for the closed book. Fades as the cover opens. */
.stage-title{position:absolute;left:0;right:var(--margin-w);top:18px;z-index:12;text-align:center;pointer-events:none;opacity:calc(1 - var(--unfold)*3);transform:translateY(calc(var(--unfold)*-14px))}
.stage[data-notes="closed"] .stage-title{right:0}
.stage-title .eyebrow{color:var(--muted);letter-spacing:.08em;text-transform:none;font-size:14px}
.stage-title h1{font-size:clamp(28px,3.2vw,42px);margin:0 0 6px}
.stage-hint{font-size:14px;color:var(--muted);margin:0;pointer-events:auto}
.stage[data-state="open"] .stage-title{display:none}

/* Pan area. At fit it never scrolls. Above 100% it pans and does not chain to the document. */
.pan{position:relative;overflow:hidden;min-width:0;min-height:0;outline-offset:-4px}
.stage[data-zoomed="true"] .pan{overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;cursor:grab}
.stage[data-zoomed="true"] .pan.dragging{cursor:grabbing;user-select:none}
.pan{touch-action:pan-y pinch-zoom}
.stage[data-zoomed="true"] .pan{touch-action:auto}
.table{width:max-content;min-width:100%;min-height:100%;display:grid;place-items:center;padding:calc(var(--leaf-h)*.05 + 24px) 40px 28px}
.stage[data-zoomed="true"] .table{padding:40px}

/* The book itself. Spread: two leaves. Single: one. */
.book-body{position:relative;width:calc(var(--leaf-w)*2);height:var(--leaf-h);transform-style:preserve-3d;perspective:2400px;transform:translateX(calc(-25% * (1 - var(--unfold)))) rotateX(calc(6deg*(1 - var(--unfold))));flex:none}
.stage[data-layout="single"] .book-body{width:var(--leaf-w);transform:none}
.leaf{position:absolute;top:0;width:var(--leaf-w);height:var(--leaf-h);background:#fff;border-radius:1px 3px 3px 1px}
.leaf-left{left:0;border-radius:3px 1px 1px 3px;box-shadow:-3px 4px 0 #d9d2c2,-6px 8px 0 #f7f4ec,-8px 10px 22px #172b3020;transform-origin:right center;transform:rotateY(calc(60deg*(1 - var(--unfold))));opacity:clamp(0,calc(var(--unfold)*2),1)}
.leaf-right{left:var(--leaf-w);box-shadow:3px 4px 0 #d9d2c2,6px 8px 0 #f7f4ec,10px 14px 26px #172b3028}
.stage[data-layout="single"] .leaf-left{display:none}
.stage[data-layout="single"] .leaf-right{left:0}
.paper{position:absolute;inset:0;overflow:hidden;background:#fff}
.paper>canvas,.paper>img{display:block;width:100%;height:100%;object-fit:fill}
.paper.blank{background:linear-gradient(90deg,#fbf9f4,#fff)}
.paper.pending::after{content:"";position:absolute;inset:0;background:linear-gradient(90deg,#fff 0,#f6f2ea 45%,#fff 90%);background-size:200% 100%;animation:paper-shimmer 1.4s linear infinite;opacity:.9}
@keyframes paper-shimmer{from{background-position:-200% 0}to{background-position:200% 0}}
.leaf-left .paper::after{content:"";position:absolute;inset:0;pointer-events:none;background:linear-gradient(90deg,transparent 88%,#1d2b3010)}
.leaf-right .paper::after{content:"";position:absolute;inset:0;pointer-events:none;background:linear-gradient(270deg,transparent 88%,#1d2b3012)}
.leaf-left .paper.pending::after,.leaf-right .paper.pending::after{background:linear-gradient(90deg,#fff 0,#f6f2ea 45%,#fff 90%)}
.spine{position:absolute;top:0;left:calc(var(--leaf-w) - 16px);width:32px;height:100%;pointer-events:none;z-index:6;background:linear-gradient(90deg,transparent,#19202a1f 46%,#19202a33 50%,#19202a1f 54%,transparent);opacity:var(--unfold)}
.stage[data-layout="single"] .spine{display:none}
.stage[data-state="open"] .leaf{cursor:pointer}
.stage[data-zoomed="true"] .leaf{cursor:pointer}
.stage[data-zoomed="true"] .pan.dragging .leaf{cursor:grabbing}

/* Closed paperback (exact supplied render) sits over the right leaf, and hands off to the hinged cover. */
.closed-book{position:absolute;z-index:9;left:75%;top:50%;height:calc(var(--leaf-h)*1.1);width:auto;max-width:none;transform:translate(-50%,-50%);pointer-events:none;filter:drop-shadow(12px 22px 18px #192a3028);opacity:clamp(0,calc(1 - var(--unfold)*9),1)}
.stage[data-layout="single"] .closed-book{left:50%}
.cover{position:absolute;top:0;left:var(--leaf-w);width:var(--leaf-w);height:var(--leaf-h);z-index:8;transform-origin:left center;transform-style:preserve-3d;transform:rotateY(calc(-180deg*var(--unfold)));opacity:clamp(0,calc((1 - var(--unfold))*12),1)}
.stage[data-layout="single"] .cover{left:0}
.cover-front,.cover-back{position:absolute;inset:0;backface-visibility:hidden;border-radius:2px 4px 4px 2px;overflow:hidden;background:#fff}
.cover-front{box-shadow:2px 0 0 #b55212,4px 7px 13px #14283026}
.cover-front img{width:100%;height:100%;object-fit:fill;display:block}
.cover-back{transform:rotateY(180deg);background:#faf8f1}
.stage[data-state="open"] .closed-book,.stage[data-state="open"] .cover{display:none}
.stage[data-state="closed"] .leaf-left{visibility:hidden}

/* Two-sided turning sheet. Front = the page leaving, back = the page arriving. */
.sheet{position:absolute;top:0;width:var(--leaf-w);height:var(--leaf-h);display:none;z-index:7;transform-style:preserve-3d;pointer-events:none}
.sheet .face{position:absolute;inset:0;backface-visibility:hidden;background:#fff;overflow:hidden;border-radius:1px 3px 3px 1px}
.sheet .face>canvas,.sheet .face>img{display:block;width:100%;height:100%}
.sheet .face-back{transform:rotateY(180deg)}
.sheet.forward{display:block;left:var(--leaf-w);transform-origin:left center;animation:turn-forward var(--turn-ms,900ms) cubic-bezier(.32,.6,.25,1) both}
.sheet.backward{display:block;left:0;transform-origin:right center;animation:turn-backward var(--turn-ms,900ms) cubic-bezier(.32,.6,.25,1) both}
.sheet.forward .face-front{box-shadow:-2px 6px 16px #17283040}
.sheet.backward .face-front{box-shadow:2px 6px 16px #17283040}
@keyframes turn-forward{0%{transform:rotateY(0)}100%{transform:rotateY(-180deg)}}
@keyframes turn-backward{0%{transform:rotateY(0)}100%{transform:rotateY(180deg)}}
.stage[data-layout="single"] .sheet.forward{left:0;animation-name:lift-forward}
.stage[data-layout="single"] .sheet.backward{left:0;transform-origin:left center;animation-name:lift-backward}
@keyframes lift-forward{0%{transform:rotateY(0);opacity:1}70%{opacity:1}100%{transform:rotateY(-120deg);opacity:0}}
@keyframes lift-backward{0%{transform:rotateY(-120deg);opacity:0}30%{opacity:1}100%{transform:rotateY(0);opacity:1}}
.stage[data-layout="single"] .sheet.backward .face-back{display:none}

/* Annotation marks on the outer edge of a page, numbered to match the margin. */
.note-marks{position:absolute;top:0;bottom:0;width:0;pointer-events:none}
.leaf-left .note-marks{left:0}
.leaf-right .note-marks{right:0}
.note-mark{position:absolute;top:calc(var(--at)*100%);width:22px;height:22px;border-radius:50%;background:var(--orange);color:#2c251a;font:700 11px/22px Lato,sans-serif;text-align:center;box-shadow:0 2px 6px #17283030;pointer-events:auto;cursor:pointer;border:0;padding:0}
.leaf-left .note-mark{left:-11px}
.leaf-right .note-mark{right:-11px}
.stage[data-layout="single"] .leaf-right .note-mark{right:-11px}
.stage[data-notes="closed"] .note-mark{opacity:.55}

/* Fore-edge navigation: the block of pages on each side of the open book. */
.fore-edge{position:absolute;top:2%;height:96%;width:16px;border:0;padding:0;z-index:5;opacity:0;transition:opacity .25s;background:repeating-linear-gradient(180deg,#fff 0 1px,#e6dfd0 1px 2px);border-radius:2px;box-shadow:0 2px 6px #17283020;cursor:ns-resize}
.fore-edge-left{left:-14px}
.fore-edge-right{right:-14px}
.stage:not([data-state="open"]) .fore-edge{pointer-events:none}
.stage[data-state="open"] .fore-edge{opacity:.8}
.stage[data-state="open"] .fore-edge:hover,.stage[data-state="open"] .fore-edge:focus-visible{opacity:1}
.stage[data-layout="single"] .fore-edge-left{left:-14px}
.stage[data-zoomed="true"] .fore-edge{display:none}
.edge-tip{position:absolute;z-index:14;background:var(--ink);color:#fff;font-size:12px;line-height:1.3;padding:6px 9px;border-radius:5px;white-space:nowrap;pointer-events:none;transform:translateY(-50%)}
.edge-tip.at-left{right:calc(100% + 20px)}
.edge-tip.at-right{left:calc(100% + 20px)}

/* Persistent margin. */
.margin{grid-column:2;grid-row:1;min-width:0;min-height:0;border-left:1px solid var(--rule);padding:22px 22px 18px;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;font-size:14px;background:var(--cream)}
.margin-head{display:flex;gap:12px;align-items:center;margin-bottom:18px}
.margin-head img{width:42px;height:auto;flex:none}
.margin-head p{margin:0}
.margin-head .eyebrow{margin-bottom:4px}
.margin-chapter{font-family:"Iowan Old Style",Georgia,serif;font-size:17px;line-height:1.25}
.margin-pages{font-size:12px;color:var(--muted)}
.margin-empty{color:var(--muted);font-size:13px}
.note{position:relative;border-left:2px solid var(--orange);padding:2px 0 2px 14px;margin:0 0 18px}
.note .note-number{position:absolute;left:-13px;top:0;width:22px;height:22px;border-radius:50%;background:var(--orange);color:#2c251a;font:700 11px/22px Lato,sans-serif;text-align:center}
.note .eyebrow{margin-bottom:4px}
.note h3{font-family:"Iowan Old Style",Georgia,serif;font-style:italic;font-size:17px;margin:0 0 6px}
.note p{color:var(--muted);margin:0 0 8px;font-size:13px}
.note a{font-weight:700;display:inline-block}
.note.is-current{background:#ff932d14;border-radius:0 6px 6px 0}
.margin-chapter-links{border-top:1px solid var(--rule);padding-top:14px;margin-top:6px}
.margin-chapter-links h3{font-size:16px;margin:0 0 6px}
.margin-chapter-links p{color:var(--muted);font-size:13px;margin:0 0 10px}
.margin-link{display:block;font-size:14px;margin:8px 0}
.margin-team{border-top:1px solid var(--rule);padding-top:16px;margin-top:20px;font-size:13px}
.margin-team p{margin:0 0 4px}
.margin-team a{color:#a54c0e;font-weight:700}

/* Compact folio. */
.folio{grid-column:1 / -1;grid-row:2;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:0 16px;border-top:1px solid var(--rule);background:var(--cream);font-size:13px;z-index:13}
.folio-group{display:flex;align-items:center;gap:6px;min-width:0}
.folio button{border:1px solid transparent;background:transparent;border-radius:6px;min-width:34px;height:34px;padding:0 8px;font-size:15px;line-height:1}
.folio button:hover:not(:disabled){border-color:var(--rule);background:#fff}
.folio button[aria-pressed="true"]{background:#fff;border-color:var(--rule)}
.folio-turn button{font-size:24px;width:40px}
.folio select{border:1px solid transparent;background:transparent;border-radius:6px;padding:6px 4px;max-width:min(300px,34vw);font-size:13px;text-overflow:ellipsis}
.folio select:hover{border-color:var(--rule);background:#fff}
.folio-page{display:flex;align-items:center;gap:6px;color:var(--muted)}
.folio-page input{width:54px;padding:5px 6px;border:1px solid var(--rule);border-radius:5px;background:#fff;text-align:center;font-size:13px}
.folio-page input::-webkit-inner-spin-button{display:none}
.folio output{min-width:44px;text-align:center;font-variant-numeric:tabular-nums}
.stage[data-state="closed"] .folio-turn,.stage[data-state="closed"] .folio-view{visibility:hidden}

/* After the runway. */
.after-book{padding:72px 32px 96px;max-width:760px;margin:auto}
.after-book h2{font-size:32px}
.after-book p{color:var(--muted)}
.after-links{display:flex;flex-wrap:wrap;gap:22px;font-weight:700}
.noscript{padding:24px 32px}

/* Fullscreen: the stage owns the screen. */
.stage:fullscreen{position:static;height:100%;top:0;background:var(--cream)}
.stage:fullscreen .stage-title{top:32px}


/* Coach invitation dialog. Timing lives in book-invitation.js. */
.coach-prompt{border:0;border-radius:12px;width:min(680px,92vw);max-height:90svh;padding:0;overflow:auto;background:#fff;color:var(--ink);box-shadow:0 30px 70px #16232a55}
.coach-prompt[open]{display:grid;grid-template-columns:180px 1fr}
.coach-prompt::backdrop{background:#16232a88;backdrop-filter:blur(5px)}
.prompt-cover{width:100%;height:auto;padding:24px;align-self:center}
.prompt-copy{padding:32px}
.prompt-copy h2{font-size:29px}
.prompt-buy{display:inline-block;background:linear-gradient(135deg,#ffb34f,#ff922d);color:#2c251a;text-decoration:none;padding:12px 24px;border-radius:6px;font-weight:700;box-shadow:0 8px 18px #a15a1820}
.prompt-close{border:0;background:transparent;color:var(--teal);text-decoration:underline;margin-top:14px;padding:6px 0}
.prompt-reassurance{font-size:13px;margin:0}

@media(max-width:700px){
 .margin{padding:16px 14px 18px;overflow-wrap:anywhere}
 .margin-head img{display:none}
 .margin-head{gap:0}
 .margin-chapter,.note h3{font-size:15px}
 :root{--folio-h:56px}
 .book-nav{padding:0 16px}.book-nav nav{gap:14px}.book-nav a{font-size:12px}
 .stage-title{top:12px;padding:0 16px}.stage-title h1{font-size:28px}.stage-title .eyebrow{font-size:12px}
 .table{padding:56px 22px 22px}
 .folio{padding:0 8px;gap:6px}
 .folio select{max-width:34vw;font-size:12px}
 .folio-page span:last-child{display:none}
 .folio-page input{width:46px}
 .folio output{min-width:40px;font-size:12px}
 .folio button{min-width:30px;padding:0 6px}
 .fore-edge{width:14px}
 .note-mark{width:20px;height:20px;line-height:20px;font-size:10px}
 .coach-prompt[open]{display:block}.prompt-cover{width:120px;display:block;margin:auto;padding:16px}.prompt-copy{padding:20px}
 .after-book{padding:48px 20px 72px}
}
@media(prefers-reduced-motion:reduce){
 *,*::before,*::after{animation-duration:.001ms!important;transition-duration:.001ms!important}
 .book-body{transform:none}
}
@media print{
 .book-nav,.folio,.margin,.after-book,.coach-prompt,.fore-edge,.stage-title{display:none}
 /* Do not include book pages in browser print / Save as PDF output. */
 .runway,.notes-sheet{display:none!important}
}
.book-testimonials{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:32px;margin:32px 0}
.book-testimonials figure{margin:0;padding:24px 0;border-top:2px solid #ff8a20}
.book-testimonials blockquote{margin:0 0 20px;font-style:italic;font-size:1.2rem;line-height:1.6}
.book-testimonials figcaption{font-size:.95rem;line-height:1.5}
@media(max-width:700px){.book-testimonials{grid-template-columns:1fr;gap:16px}}

/* Closing copy uses the same Lato family as the reader, including headings. */
.after-book,.after-book h2,.book-testimonials{font-family:Lato,sans-serif}
.book-testimonials blockquote{font-size:1.35rem;line-height:1.55;font-style:normal}
.book-testimonials figcaption{font-size:1rem}

/* One final page turn closes the preview into a purchase invitation. */
.book-ending{grid-column:1/-1;grid-row:2;z-index:20;align-self:stretch;display:flex;align-items:center;justify-content:center;gap:clamp(24px,5vw,76px);padding:clamp(24px,5vw,64px);overflow:auto;background:var(--cream);animation:ending-reveal .65s .35s both}
.book-ending>img{width:clamp(150px,24vw,290px);max-height:65vh;object-fit:contain;filter:drop-shadow(8px 18px 15px #18272d25)}
.book-ending-copy{max-width:470px}
.book-ending h2{font:700 clamp(34px,4vw,58px)/1.1 Lato,sans-serif;margin:0 0 24px}
.book-ending p:not(.eyebrow){font-size:clamp(18px,1.7vw,22px);line-height:1.6;margin-bottom:28px}
.book-ending .eyebrow{font-size:12px}
.book-ending .prompt-buy{font-size:19px;padding:16px 26px}
.book-ending-back{display:block;margin-top:24px;font-size:16px}
.stage[data-ending="true"] .pan,.stage[data-ending="true"]>.margin{pointer-events:none}
.stage[data-ending="true"] .leaf-right{transform-origin:left center;animation:ending-close .5s both}
.stage[data-ending="true"] .page-turn-hint{display:none}
@keyframes ending-close{to{transform:rotateY(-160deg);opacity:0}}
@keyframes ending-reveal{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:translateY(0)}}
@media(max-width:700px){
 .book-ending{flex-direction:column;justify-content:flex-start;gap:16px;padding:24px;text-align:center}
 .book-ending>img{width:130px;max-height:170px;flex-shrink:0}
 .book-ending h2{font-size:34px;margin-bottom:16px}
 .book-ending p:not(.eyebrow){font-size:18px;margin-bottom:20px}
 .book-ending-back{margin:20px auto 0}
}
@media(prefers-reduced-motion:reduce){.book-ending,.stage[data-ending="true"] .leaf-right{animation:none}}
@media print{.book-ending{display:none!important}}

.book-ending-team{display:block;margin-top:24px;font:700 19px/1.4 Lato,sans-serif}
.book-ending .ending-link-hint{font-size:13px!important;line-height:1.4!important;margin:18px 0!important;color:var(--muted)}
