/* Pocket edition. Desktop keeps the original two-leaf composition. */
.mobile-reader-nav, .mobile-marginal-note { display:none; }
.page-scroller { position:static; }

@media (max-width:760px), (hover:none) and (pointer:coarse) and (max-width:1024px) {
  :root {
    --pocket-safe-top:env(safe-area-inset-top,0px);
    --pocket-safe-bottom:env(safe-area-inset-bottom,0px);
    --pocket-safe-left:env(safe-area-inset-left,0px);
    --pocket-safe-right:env(safe-area-inset-right,0px);
    --pocket-viewport:100vh;
    --pocket-footer:64px;
    --page-inset:22px;
    --editorial-gap:20px;
  }
  @supports (height:100svh) { :root { --pocket-viewport:100svh; } }
  @supports (height:100dvh) { :root { --pocket-viewport:100dvh; } }
  html, body { width:100%; height:100%; overflow:hidden; overscroll-behavior:none; }
  .site-shell { width:100%; height:var(--pocket-viewport); min-height:0; overflow:hidden; }
  .reading-room {
    width:100%; height:100%; min-height:0;
    padding:var(--pocket-safe-top) var(--pocket-safe-right) var(--pocket-safe-bottom) var(--pocket-safe-left);
    overflow:hidden;
  }
  .book-window {
    --leaf-width:calc(100vw - var(--pocket-safe-left) - var(--pocket-safe-right) - 36px);
    --leaf-height:calc(var(--pocket-viewport) - var(--pocket-safe-top) - var(--pocket-safe-bottom) - 44px);
    width:calc(var(--leaf-width) + 30px);
    height:calc(var(--pocket-viewport) - var(--pocket-safe-top) - var(--pocket-safe-bottom));
    min-height:0; max-height:none; overflow:clip;
  }
  .book { left:calc(-1 * var(--leaf-width) + 7px); top:12px; width:calc(var(--leaf-width) * 2); height:var(--leaf-height); min-height:0; transform:none; }
  .left-leaf { clip-path:none; }
  .engine-leaf { border-radius:16% 2px 2px 16% / 1% 2px 2px 1%; }
  .spine { width:17px; left:calc(50% - 6px); top:1.5%; bottom:1.5%; }
  .right-leaf { min-height:0; border-top-left-radius:16% 1%; border-bottom-left-radius:16% 1%; }
  .wordmark, .left-leaf .marginal-note { display:none; }
  .chapter-navigation { position:static; display:contents; }
  .chapter-navigation .chapter-index { display:none; }
  .page-scroller {
    position:absolute; top:0; right:0; bottom:var(--pocket-footer); left:0;
    min-height:0; overflow-x:hidden; overflow-y:auto; overscroll-behavior-y:contain;
    touch-action:pan-y pinch-zoom; -webkit-overflow-scrolling:touch;
    scrollbar-width:none; scroll-behavior:auto;
  }
  .page-scroller::-webkit-scrollbar { display:none; }
  .page-content {
    position:relative; inset:auto; width:100%; height:auto; min-height:100%;
    padding:28px 22px 30px 26px; overflow:visible; outline:none;
  }
  .right-leaf > .page-footer { display:none; }
  .reader-controls { display:none; }
  .mobile-reader-nav {
    position:absolute; z-index:8; left:20px; right:56px; bottom:8px; height:44px;
    display:grid; grid-template-columns:minmax(52px,1fr) 44px minmax(36px,auto) 44px;
    align-items:center; gap:3px; color:var(--ink);
  }
  .mobile-reader-nav::before { content:''; position:absolute; left:0; right:-32px; top:-7px; height:1px; background:#35352f20; pointer-events:none; }
  .mobile-reader-nav button { display:grid; align-items:center; justify-items:center; min-width:44px; min-height:44px; padding:0 5px; font:400 12px/1 var(--sans); }
  .mobile-reader-nav .mobile-index { justify-items:start; padding-left:0; }
  .mobile-reader-nav .mobile-previous, .mobile-reader-nav .mobile-next { font-size:18px; }
  .mobile-reader-nav button:disabled { opacity:.25; pointer-events:none; }
  .mobile-reader-nav button:focus-visible { outline-offset:-5px; }
  .mobile-folio { text-align:center; font:400 9px/1 var(--sans); font-variant-numeric:tabular-nums; white-space:nowrap; }
  .mobile-reader-nav .mobile-folio { min-width:36px; padding:0; font-size:9px; font-variant-numeric:tabular-nums; white-space:nowrap; }
  .previous-corner { display:none; }
  .next-corner { width:50px; height:58px; bottom:0; right:0; z-index:7; touch-action:none; }
  .next-corner span { opacity:0; }
  .next-corner::before { width:19px; height:19px; opacity:.55; }
  .next-corner:hover::before, .next-corner:focus-visible::before { width:19px; height:19px; }
  .next-corner:hover span { opacity:0; }
  .next-corner:focus-visible span { opacity:1; }
  .book.touch-lifting .next-corner::before, .book.peeking .next-corner::before { opacity:0; }
  .turning .next-corner::before { opacity:0; }
  .book.touch-lifting .next-corner span { opacity:0; }
  .running-title { font-size:9px; line-height:1.2; gap:16px; }
  .running-title span:last-child { max-width:48%; }
  .introduction { min-height:100%; display:flex; flex-direction:column; }
  .intro-name { position:relative; top:auto; right:auto; width:110px; align-self:flex-end; }
  .intro-name h1, .intro-name p { font-size:12px; }
  .intro-name p { margin-left:-28px; }
  .intro-portrait { position:relative; top:auto; left:auto; transform:none; margin:clamp(52px,18dvh,150px) auto 28px; }
  .intro-portrait { --print-width:110px; }
  .portrait-mount { margin-bottom:24px; }
  .intro-portrait figcaption { width:190px; font-size:10px; }
  .reading-return { display:none; }
  .pocket-resume { align-self:center; width:210px; margin:8px auto 22px; }
  .pocket-resume button { min-height:44px; padding:8px 0; color:var(--ink); font:400 11px/1.3 var(--sans); border-bottom:1px solid #96897566; }
  .chapter-heading, .work-page .chapter-heading, .project-page .chapter-heading { margin-top:38px; margin-bottom:24px; font-size:12px; }
  .information-grid { margin-top:40px; }
  .information-row { grid-template-columns:minmax(0,.7fr) minmax(0,1.3fr); padding-top:23px; padding-bottom:23px; gap:20px; }
  .information-row .chapter-heading { margin:0; }
  .information-label, .information-value { font-size:12px; line-height:1.35; }
  .information-value .large-copy { font:inherit; margin-bottom:15px; }
  .page-content a, .page-content .text-link, .page-content button.begin-again {
    min-height:44px; align-items:center; padding-top:8px; padding-bottom:8px;
  }
  .page-content a { display:inline-flex; }
  .essay-index .chapter-heading { margin-top:42px; margin-bottom:24px; }
  .chapter-subtitle { margin-bottom:30px; font-size:12px; }
  .essay-list { margin-top:35px; row-gap:30px; }
  .essay-entry { min-height:88px; }
  .entry-title { font-size:13px; line-height:1.2; }
  .entry-number, .entry-date, .entry-page { font-size:9px; }
  .essay .chapter-heading, .essay-short .chapter-heading, .essay-compact .chapter-heading { margin-top:40px; margin-bottom:17px; font-size:12px; }
  .essay-meta, .essay-short .essay-meta, .essay-compact .essay-meta { margin-bottom:28px; font-size:10px; align-items:center; }
  .essay-meta a { min-height:44px; }
  .essay-body, .essay-compact .essay-body { width:100%; max-width:none; margin-left:0; color:var(--ink); font-size:16px; line-height:1.5; letter-spacing:0; }
  .essay-body p { margin:0; }
  .essay-body p + p { text-indent:1.3em; }
  .essay-body .essay-subheading { margin:24px 0 10px; font-size:16px; line-height:1.3; }
  .essay-body .essay-subheading + p { text-indent:0; }
  .continuation .essay-body { margin-top:40px; }
  .essay-return { position:static; display:inline-flex; align-items:center; min-height:44px; margin-top:30px; padding:8px 0; color:var(--ink); font-size:11px; }
  .project-figure, .practice-page .project-figure { margin:22px 0 19px; }
  .project-page .project-figure img, .practice-page .project-figure img { width:100%; height:auto; max-height:none; object-fit:contain; }
  .project-figure figcaption { color:var(--ink); font-size:10px; line-height:1.3; }
  .project-copy { margin-top:22px; }
  .project-details { font-size:12px; line-height:1.3; }
  .project-description, .practice-page .project-description { font-size:13px; line-height:1.4; }
  .project-copy > .text-link { font-size:11px; }
  .contact-page .information-grid, .colophon-page .information-grid { margin-top:70px; }
  .contact-email { font-size:12px; }
  .contact-afterword { position:static; margin-top:50px; font-size:10px; }
  .colophon-return { margin-top:32px; }
  .begin-again { font-size:12px; }
  .mobile-marginal-note {
    display:block; margin-top:36px; padding-top:17px; border-top:1px solid #35352f26;
    color:var(--ink); font:400 14px/1.35 var(--sans);
  }
  .mobile-marginal-note .marginal-label { margin-bottom:10px; color:inherit; font-size:11px; }
  .mobile-marginal-note .marginal-text { font-size:14px; line-height:1.35; }
  .pocket-index-heading { margin:28px 0 35px; font:400 12px/1.2 var(--sans); }
  .pocket-index-list { display:flex; flex-direction:column; gap:0; }
  .pocket-index-link {
    display:grid; grid-template-columns:24px 1fr 32px; align-items:center; gap:10px;
    width:100%; min-height:52px; padding:9px 0; border-top:1px solid #35352f26;
    color:var(--ink); text-align:left; font:400 16px/1.2 var(--sans);
  }
  .pocket-index-link:last-child { border-bottom:1px solid #35352f26; }
  .pocket-index-number, .pocket-index-folio { font-size:10px; font-variant-numeric:tabular-nums; }
  .pocket-index-folio { text-align:right; }
  .turn-page-scroller { position:absolute; inset:0 0 var(--pocket-footer) 0; overflow:hidden; }
  .turn-page-scroller > .page-content { min-height:100%; transform-origin:top left; }
  .engine-leaf > .page-footer { display:none; }
}

@media (min-width:500px) and (max-width:760px) and (max-height:500px), (min-width:500px) and (hover:none) and (pointer:coarse) and (max-width:1024px) and (max-height:500px) {
  .page-content { padding:20px 22px 24px 26px; }
  .introduction { display:grid; grid-template-columns:1fr 1fr; align-items:start; column-gap:30px; }
  .intro-name { grid-column:2; grid-row:1; justify-self:end; }
  .intro-portrait { grid-column:1; grid-row:1; justify-self:start; margin:0; }
  .intro-portrait { --print-width:72px; }
  .portrait-mount { margin:0 0 16px; }
  .intro-portrait figcaption { width:170px; margin-left:0; font-size:9px; }
  .intro-portrait .portrait-subject { margin-left:16px; font-size:9px; }
  .pocket-resume { grid-column:1 / -1; margin:18px 0 0; width:auto; }
  .pocket-resume button { font-size:10px; }
  .pocket-index-heading { margin-top:16px; margin-bottom:22px; }
  .pocket-index-link { min-height:46px; }
}

@media (prefers-reduced-motion:reduce) {
  .book.touch-lifting .next-corner::before { opacity:.4; }
}
