/* Modal Path Ethics — The Book Was More Than the Text v6.34
   A paper line above a distant warehouse floor. Continuous shredder motion was
   removed: machines animate only while the reader is actually shredding/restoring. */
html.mpe-book-page {
    --tlb-paper: #eee6d0;
    --tlb-paper-deep: #d9cba7;
    --tlb-ink: #263027;
    --tlb-olive: #344836;
    --tlb-gold: #c79c45;
    --tlb-green: #81a968;
    --tlb-red: #a94f3f;
    --tlb-width: 870px;
    background: #09110d;
}
html.mpe-book-page,
html.mpe-book-page body { max-width: 100%; overflow-x: clip; }
html.mpe-book-page body {
    color: var(--tlb-ink);
    background: #09110d !important;
    overflow-x: clip;
}
html.mpe-book-page .gh-site { position: relative; z-index: 2; background: transparent !important; }
html.mpe-book-page .gh-main,
html.mpe-book-page .gh-article { background: transparent !important; }
html.mpe-book-page .gh-main { padding-bottom: 3rem; }

/* Only a distant floor remains in the background. No shelving / bins / giant scenery. */
.tlb-warehouse {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
    background:
        radial-gradient(ellipse at 50% 66%, rgba(62,88,61,.10), transparent 30%),
        linear-gradient(180deg, #09110d 0 60%, #101a14 60.2% 100%);
}
.tlb-warehouse::before {
    content: "";
    position: absolute;
    left: -18%;
    right: -18%;
    top: 60%;
    bottom: -18%;
    transform-origin: 50% 0;
    transform: perspective(650px) rotateX(63deg);
    background:
        repeating-linear-gradient(90deg, rgba(158,171,137,.08) 0 1px, transparent 1px 74px),
        repeating-linear-gradient(0deg, rgba(158,171,137,.06) 0 1px, transparent 1px 56px),
        linear-gradient(180deg, #222b22 0, #111a14 72%, #080e0a 100%);
    border-top: 1px solid rgba(173,190,149,.13);
    box-shadow: 0 -20px 70px rgba(0,0,0,.72), inset 0 35px 65px rgba(255,255,255,.018);
}
.tlb-warehouse::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(180deg, transparent 0 48%, rgba(3,8,5,.16) 64%, rgba(2,6,4,.42) 100%);
    box-shadow: inset 0 0 130px 34px rgba(1,5,3,.55);
}
.tlb-warehouse canvas { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
html.mpe-book-page[data-color-scheme="light"] .tlb-warehouse { filter: brightness(1.14) saturate(.86); }

/* Header is now the first archival leaf rather than a dark floating slab. */
html.mpe-book-page .gh-article-header {
    display: grid !important;
    grid-template-columns: minmax(0,1fr);
    position: relative;
    box-sizing: border-box;
    width: min(var(--tlb-width), calc(100% - 60px));
    margin: clamp(38px,6vw,74px) auto clamp(78px,8vw,112px) !important;
    padding: clamp(38px,5.5vw,66px) clamp(30px,6vw,72px) clamp(44px,6vw,70px);
    color: var(--tlb-ink) !important;
    background:
        linear-gradient(90deg, rgba(98,92,56,.12), transparent 8%, transparent 92%, rgba(98,92,56,.13)),
        url("book-paper-fibre.svg") 0 0 / 190px 270px repeat,
        linear-gradient(180deg, #f2ead7, #e6dcc1) !important;
    border: 1px solid rgba(166,151,105,.62);
    border-radius: 2px;
    box-shadow:
        0 28px 56px rgba(0,0,0,.48),
        -7px 7px 0 #8f8d69,
        -11px 11px 0 #25352a,
        inset 6px 0 10px rgba(143,126,73,.10),
        inset -5px 0 8px rgba(111,92,48,.08);
    overflow: visible;
}
html.mpe-book-page .gh-article-header::before {
    content: "";
    position: absolute;
    left: -12px;
    top: 0;
    bottom: 0;
    width: 12px;
    background: linear-gradient(90deg,#111e16,#304834 42%,#1b2a20 70%,#080d0a);
    box-shadow: inset -1px 0 rgba(211,189,116,.28);
}
html.mpe-book-page .gh-article-header::after {
    content: "";
    position: absolute;
    right: 22px;
    top: 22px;
    width: 13px;
    height: 18px;
    background: var(--tlb-gold);
    clip-path: polygon(50% 0,100% 50%,50% 100%,0 50%);
    box-shadow: 0 0 0 1px rgba(55,58,37,.28), 0 0 16px rgba(199,156,69,.18);
}
html.mpe-book-page .gh-article-header > * { grid-column: 1 !important; }
html.mpe-book-page .gh-article-title {
    max-width: 760px;
    margin: 0;
    color: #243025 !important;
    font-size: clamp(31px,4.7vw,56px);
    line-height: 1.13;
    letter-spacing: -.027em;
    text-wrap: balance;
}
html.mpe-book-page .gh-article-tag { color: #6f6236 !important; }
html.mpe-book-page .gh-article-excerpt {
    max-width: 690px;
    margin-top: 20px;
    color: #5f6857 !important;
    font-size: clamp(17px,2vw,22px);
}
html.mpe-book-page .gh-article-sidebar { margin-top: 28px; color: #5b6356 !important; }
html.mpe-book-page .gh-article-sidebar a { color: #344b37 !important; }
html.mpe-book-page .gh-article-image {
    max-width: 100%;
    margin: 34px 0 0;
    padding: 10px !important;
    background: #d7ccb0 !important;
    border: 1px solid rgba(109,103,71,.42) !important;
    box-shadow: 0 8px 18px rgba(45,48,28,.18), inset 0 0 0 1px rgba(255,255,255,.38);
}
html.mpe-book-page .gh-article-image::before,
html.mpe-book-page .gh-article-image::after { content: none !important; display: none !important; }
html.mpe-book-page .gh-article-image img { display: block; width: 100%; height: auto; }

/* Paper line. */
html.mpe-book-page .gh-content.tlb-paper-line {
    display: block !important;
    position: relative;
    width: min(var(--tlb-width),calc(100% - 76px));
    max-width: none;
    min-width: 0;
    margin: 0 auto;
    padding: 0;
    color: var(--tlb-ink);
    font-family: var(--gh-font-body,var(--font-serif,Georgia,serif));
    font-size: 19px;
    line-height: 1.82;
}
.tlb-roll { position: relative; margin: 0 !important; padding-bottom: 126px; }
.tlb-sheet-clip { position: relative; z-index: 2; overflow: hidden; }
.tlb-sheet {
    box-sizing: border-box;
    position: relative;
    min-width: 0;
    padding: 54px clamp(28px,5.5vw,68px) 70px;
    background: var(--tlb-paper);
    color: var(--tlb-ink) !important;
    border-left: 1px solid rgba(255,250,222,.68);
    border-right: 1px solid rgba(181,169,128,.62);
    box-shadow: 8px 14px 5px rgba(5,12,5,.24), 28px 30px 35px rgba(0,0,0,.42), inset 5px 0 6px rgba(194,175,119,.14), inset -5px 0 5px rgba(170,143,77,.08);
    isolation: isolate;
    transform-origin: 50% 100%;
}
.tlb-sheet::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0;
    pointer-events: none;
    background:
        url("book-paper-fibre.svg") 0 0 / 180px 256px repeat,
        repeating-linear-gradient(180deg,transparent 0 555px,rgba(193,173,117,.075) 567px,rgba(255,251,223,.16) 570px,transparent 579px,transparent 640px);
}
.tlb-sheet::after {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(90deg,rgba(187,167,103,.10),transparent 9%,transparent 92%,rgba(187,167,103,.12));
}
.tlb-feed-edge { display: none !important; }
.tlb-sheet > * { max-width: 100%; position: relative; }
html.mpe-book-page .gh-content .tlb-sheet :is(p,li,ul,ol,dl,dd,dt,strong,em,b,i,.dl-token) { color: inherit !important; }
.tlb-sheet > * + * { margin-top: 1.35em; margin-bottom: 0; }
.tlb-sheet > :first-child { margin-top: 0 !important; }
.tlb-sheet > :last-child { margin-bottom: 0; }
.tlb-sheet :is(h1,h2,h3,h4,h5,h6) { color: #29392a !important; scroll-margin-top: 90px; text-wrap: balance; }
.tlb-sheet > h2 { font-size: clamp(26px,3.4vw,38px); line-height: 1.26; margin-top: 1.8em; margin-bottom: .8em; }
.tlb-sheet > h3 { font-size: clamp(23px,2.9vw,29px); line-height: 1.35; margin-top: 1.8em; margin-bottom: .65em; }
.tlb-sheet a { color: #3b5e36 !important; text-decoration-color: #92824d; text-decoration-thickness: 1px; text-underline-offset: .14em; }
.tlb-sheet blockquote,
.tlb-sheet blockquote.kg-blockquote-alt {
    position: relative;
    padding: .6em 1.1em;
    margin: 1.5em 0;
    font-family: inherit;
    font-size: 1.1em;
    line-height: 1.65;
    letter-spacing: 0;
    background: linear-gradient(90deg,rgba(164,174,119,.10),transparent);
    color: #344d31 !important;
    border: 0;
    border-left: 2px solid #879068;
    box-shadow: none;
    text-align: left;
}
.tlb-sheet blockquote::before,.tlb-sheet blockquote::after { content: none !important; }
.tlb-sheet blockquote > :first-child { margin-top: 0; }
.tlb-sheet blockquote > :last-child { margin-bottom: 0; }
.tlb-sheet :is(ul,ol) { padding-left: 1.3em; }
.tlb-sheet li > :is(ul,ol) { margin-top: .45em; }
.tlb-sheet li + li { margin-top: .4em; }
.tlb-sheet :is(.kg-width-wide,.kg-width-full,.kg-card) { width: 100% !important; max-width: 100% !important; margin-left: 0; margin-right: 0; }
.tlb-sheet figure { margin-top: 2em; margin-bottom: 2em; }
.tlb-sheet figure img { display: block; width: auto; max-width: 100%; height: auto; margin: 0 auto; box-shadow: 0 4px 12px rgba(54,55,29,.12); }
.tlb-sheet figcaption { color: #5d6651 !important; font-family: inherit; line-height: 1.6; }
.tlb-sheet :is(pre,table,.kg-table-card,.mpe-table-card) { max-width: 100%; overflow-x: auto; }
.tlb-sheet pre { white-space: pre; }

/* Rails stay, but all perpetual machine animation is gone. */
.tlb-paper-line::before,.tlb-paper-line::after {
    content: "";
    position: absolute;
    top: -54px;
    bottom: 72px;
    width: 13px;
    z-index: 0;
    pointer-events: none;
    background: linear-gradient(90deg,#080f0c,#465444 17%,#19251c 27%,#111d16 69%,#607156 75%,#1c281d 87%,#060b08);
    box-shadow: 20px 16px 14px rgba(0,0,0,.52);
}
.tlb-paper-line::before { left: -22px; }
.tlb-paper-line::after { right: -22px; }
.tlb-station { position: relative; z-index: 4; height: 82px; margin: -2px -32px 0; pointer-events: auto; }
.tlb-machine {
    position: absolute;
    inset: 0;
    border: 1px solid #62705c;
    border-radius: 4px 4px 9px 9px;
    background: linear-gradient(180deg,#63705a 0,#303d30 4%,#132016 13%,#070c08 16%,#111e15 44%,#758166 46%,#3a4937 49%,#243021 63%,#111c13 95%,#060c08);
    box-shadow: 0 9px 9px rgba(0,0,0,.60), 0 2px 1px #131e10, inset 0 1px 0 rgba(170,177,151,.30);
}
.tlb-machine::before,.tlb-machine::after {
    content: "";
    position: absolute;
    top: 24px;
    width: 20px;
    height: 34px;
    border: 1px solid #787d5a;
    border-radius: 3px;
    background: linear-gradient(90deg,#182116,#616749,#1f2c1c);
    box-shadow: 3px 3px 3px rgba(0,0,0,.55);
}
.tlb-machine::before { left: 8px; }
.tlb-machine::after { right: 8px; }
.tlb-intake {
    position: absolute;
    left: 35px;
    right: 35px;
    top: 8px;
    height: 28px;
    overflow: hidden;
    border-radius: 3px;
    background: #030705;
    box-shadow: inset 0 2px 4px #000;
}
.tlb-intake::before,.tlb-intake::after {
    content: "";
    position: absolute;
    left: -28px;
    right: -28px;
    height: 12px;
    background: repeating-linear-gradient(104deg,#89937b 0 2px,#343f31 3px 8px,#10180e 9px 12px,#79886a 13px 14px);
}
.tlb-intake::before { top: 0; }
.tlb-intake::after { bottom: 0; }
.tlb-station.is-working .tlb-intake::before { animation: tlb-teeth .22s linear infinite; }
.tlb-station.is-working .tlb-intake::after { animation: tlb-teeth .22s linear infinite reverse; }
.tlb-machine-face {
    position: absolute;
    left: 39px;
    right: 39px;
    top: 46px;
    height: 24px;
    background: linear-gradient(180deg,rgba(202,210,171,.05),transparent), repeating-linear-gradient(90deg,transparent 0 30px,rgba(6,15,8,.30) 31px 32px);
    border-top: 1px solid rgba(170,178,132,.14);
    border-bottom: 1px solid #0a140c;
}
.tlb-paper-lip {
    position: absolute;
    left: 34px;
    right: 34px;
    top: 27px;
    z-index: 1;
    height: 13px;
    background: repeating-linear-gradient(90deg,#d6ccac 0 5px,#7c795d 5px 6px,transparent 6px 8px);
    clip-path: polygon(0 0,100% 0,100% 62%,95% 80%,90% 45%,85% 100%,80% 54%,74% 86%,68% 38%,61% 90%,54% 54%,48% 100%,40% 45%,34% 86%,28% 53%,20% 100%,12% 60%,5% 85%,0 56%);
}
.tlb-shred-toggle {
    position: absolute;
    z-index: 6;
    left: 52px;
    top: 49px;
    display: grid;
    place-items: center;
    width: 20px;
    height: 18px;
    padding: 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}
.tlb-shred-toggle::before {
    content: "";
    width: 10px;
    height: 14px;
    background: var(--tlb-gold);
    clip-path: polygon(50% 0,100% 50%,50% 100%,0 50%);
    filter: drop-shadow(0 0 4px rgba(199,156,69,.26));
    transition: transform .16s ease, filter .16s ease;
}
.tlb-shred-toggle:hover::before,
.tlb-shred-toggle:focus-visible::before { transform: scale(1.15); filter: drop-shadow(0 0 7px rgba(225,187,92,.50)); }
.tlb-shred-toggle:focus-visible { outline: 1px solid #e6ce8d; outline-offset: 4px; border-radius: 50%; }
.tlb-status-light {
    position: absolute;
    z-index: 5;
    right: 54px;
    top: 55px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #9ab975;
    box-shadow: 0 0 8px rgba(184,228,140,.52);
    transition: background-color .24s ease, box-shadow .24s ease;
}
.tlb-roll.is-shredded .tlb-status-light {
    background: #b75a4c;
    box-shadow: 0 0 8px rgba(225,91,72,.54);
}
.tlb-station.is-working .tlb-status-light { animation: tlb-status-pulse .32s steps(2,end) infinite; }
html.mpe-book-page .tlb-station > hr.tlb-divider {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    clip-path: inset(50%);
    overflow: hidden;
}
.tlb-roll.is-shredded { padding-bottom: 126px; }
.tlb-roll.is-shredded .tlb-sheet-clip { height: 0 !important; }

.tlb-motion-toggle {
    display: grid;
    place-items: center;
    position: fixed;
    z-index: 390;
    left: 12px;
    bottom: 14px;
    width: 44px;
    height: 44px;
    padding: 11px;
    border: 1px solid rgba(155,172,125,.34);
    border-radius: 50%;
    background: rgba(19,33,23,.92);
    color: #e1dfbc;
    cursor: pointer;
    touch-action: manipulation;
    box-shadow: 0 3px 15px rgba(0,0,0,.34);
}
.tlb-motion-toggle svg { display: block; width: 20px; height: 20px; }
.tlb-motion-toggle:focus-visible { outline: 2px solid #b5dc80; outline-offset: 4px; }
body.is-head-open .tlb-motion-toggle,
html[data-mpe-search-open="true"] .tlb-motion-toggle { visibility: hidden; }
@keyframes tlb-teeth { to { transform: translateX(14px); } }
@keyframes tlb-status-pulse { 50% { opacity: .38; } }

@media (max-width:767px) {
    html.mpe-book-page .gh-article-header { width: calc(100% - 40px); margin-top: 34px !important; margin-bottom: 74px !important; padding: 32px 26px 38px; }
    html.mpe-book-page .gh-article-header::after { right: 15px; top: 15px; width: 11px; height: 15px; }
    html.mpe-book-page .gh-content.tlb-paper-line { width: calc(100% - 40px); font-size: 17px; line-height: 1.8; }
    .tlb-sheet { padding: 36px 25px 48px; }
    .tlb-roll,.tlb-roll.is-shredded { padding-bottom: 94px; }
    .tlb-station { margin-left: -14px; margin-right: -14px; height: 63px; }
    .tlb-machine::before,.tlb-machine::after { width: 11px; height: 28px; top: 19px; }
    .tlb-machine::before { left: 4px; }.tlb-machine::after { right: 4px; }
    .tlb-intake { left: 19px; right: 19px; top: 6px; height: 23px; }
    .tlb-paper-lip { top: 21px; left: 19px; right: 19px; }
    .tlb-machine-face { top: 37px; height: 17px; left: 22px; right: 22px; }
    .tlb-shred-toggle { left: 34px; top: 39px; width: 20px; height: 17px; }
    .tlb-shred-toggle::before { width: 9px; height: 12px; }
    .tlb-status-light { right: 36px; top: 44px; width: 6px; height: 6px; }
    .tlb-paper-line::before,.tlb-paper-line::after { width: 9px; }
    .tlb-paper-line::before { left: -13px; }.tlb-paper-line::after { right: -13px; }
    .tlb-sheet blockquote,.tlb-sheet blockquote.kg-blockquote-alt { padding: .4em .7em; font-size: 1.06em; }
    .tlb-motion-toggle { left: 5px; bottom: 8px; width: 36px; height: 36px; padding: 8px; }
}
@media (max-width:359px) { .tlb-sheet { padding-left: 19px; padding-right: 19px; } }
@media (prefers-reduced-motion:reduce) {
    .tlb-station.is-working .tlb-intake::before,
    .tlb-station.is-working .tlb-intake::after,
    .tlb-station.is-working .tlb-status-light { animation: none !important; }
}
@media print {
    .tlb-warehouse,.tlb-station,.tlb-motion-toggle { display: none !important; }
    html.mpe-book-page body,html.mpe-book-page .gh-site { background: white !important; }
    html.mpe-book-page .gh-content.tlb-paper-line { width: 100% !important; font-size: 11pt; }
    .tlb-paper-line::before,.tlb-paper-line::after,.tlb-sheet::before,.tlb-sheet::after { display: none !important; }
    .tlb-sheet-clip { height: auto !important; overflow: visible !important; }
    .tlb-sheet { padding: 0; box-shadow: none; border: 0; background: white; transform: none !important; opacity: 1 !important; }
    .tlb-roll { padding: 0; margin-bottom: 20pt !important; }
    .tlb-roll + .tlb-roll { break-before: page; }
}

/* Header metadata is deliberately re-laid out because Headline's article sidebar is
   otherwise positioned to the title's left and collides with the archival leaf. */
html.mpe-book-page .gh-article-sidebar {
    position: static !important;
    display: grid !important;
    grid-template-columns: auto minmax(0,1fr) auto;
    grid-template-rows: auto auto;
    align-items: center;
    gap: .45rem .8rem;
    width: 100%;
    max-width: 660px;
    padding: 0 !important;
    margin: 26px 0 0 !important;
}
html.mpe-book-page .gh-article-sidebar .gh-author-image-list { grid-row: 1 / 3; margin: 0 !important; }
html.mpe-book-page .gh-article-sidebar .gh-author-image { width: 42px; height: 42px; margin: 0 !important; border: 1px solid rgba(70,78,57,.35); }
html.mpe-book-page .gh-article-sidebar .gh-author-name-list,
html.mpe-book-page .gh-article-sidebar .gh-article-meta { margin: 0 !important; padding: 0 !important; }
html.mpe-book-page .gh-article-sidebar .gh-author-name { margin: 0 !important; font-size: 14px; line-height: 1.2; }
html.mpe-book-page .gh-article-sidebar .gh-article-meta { grid-column: 2; font-size: 12px; color: #6e725f !important; }
html.mpe-book-page .gh-article-sidebar .gh-button-share { grid-column: 3; grid-row: 1 / 3; align-self: center; margin: 0 !important; color: #344b37 !important; border-color: rgba(82,94,65,.28) !important; }
html.mpe-book-page .gh-article-image { grid-column: 1 !important; }

/* Push the warehouse floor farther away from the suspended paper line. */
.tlb-warehouse::before { top: 73%; }
.tlb-warehouse { background: radial-gradient(ellipse at 50% 75%, rgba(62,88,61,.08), transparent 25%), linear-gradient(180deg,#09110d 0 72.8%,#101a14 73% 100%); }
@media (max-width:767px) {
    html.mpe-book-page .gh-article-sidebar { grid-template-columns: auto minmax(0,1fr); max-width: none; }
    html.mpe-book-page .gh-article-sidebar .gh-button-share { grid-column: 1 / -1; grid-row: 3; justify-self: start; }
}
