/* Coordinates are measured on the original scene, never on the viewport. */
#aboutPortrait{position:absolute;left:46.2%;top:37.4%;width:8.6%;height:22%;min-width:44px;min-height:44px;z-index:4;border:0;padding:0;border-radius:48%;background:transparent;cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent}
#journey[data-mobile=true] #aboutPortrait{left:27%;top:43%;width:19%;height:12%}
.portrait-lift{position:absolute;inset:0;pointer-events:none;z-index:3;transition:transform 260ms ease,filter 260ms ease}
.portrait-lift>img{position:absolute;inset:0;width:100%;height:100%;clip-path:polygon(46.4% 58.8%,46.4% 45%,47.3% 40.7%,49.1% 38.8%,49.8% 37.5%,50.6% 38.5%,51.4% 38.9%,53.2% 42%,54.7% 47%,54.7% 52%,53.6% 58.4%,52% 59%,48% 59%)}
#journey[data-mobile=true] .portrait-lift>img{clip-path:polygon(27% 54.8%,27% 48%,28.6% 45.4%,32% 43.8%,35.8% 43%,38% 43.7%,41.7% 44.7%,44.6% 47%,45.5% 50%,44% 53%,43.4% 54.9%,40% 55.1%,29% 55.1%)}
.portrait-lift>.portrait-linen{clip-path:polygon(47.45% 51.9%,48.75% 51.1%,49.6% 52.9%,50.25% 53.5%,51% 52.9%,51.65% 51.15%,53.1% 52%,52.65% 54.65%,51.9% 55.8%,50.6% 56.3%,49.05% 55.8%,48% 54.4%)}
#aboutPortrait:focus-visible{outline:2px solid #e2c799;outline-offset:4px}
@media(hover:hover){#tablePlane:has(#aboutPortrait:hover) .portrait-lift{transform:translateY(-2px);filter:brightness(1.08) drop-shadow(0 0 5px #e6ba7755)}}
#tablePlane:has(#aboutPortrait:focus-visible) .portrait-lift{transform:translateY(-2px);filter:brightness(1.08) drop-shadow(0 0 5px #e6ba7755)}
#aboutPortrait:active{background:#e6ba7718}
#aboutDialog{border:0;padding:20px;margin:auto;width:min(590px,calc(100% - 48px));max-width:none;max-height:calc(100dvh - 64px);overflow:auto;background:transparent;color:#493b2d;opacity:0;transform:translateY(12px);transition:opacity 360ms ease,transform 360ms ease,display 360ms allow-discrete,overlay 360ms allow-discrete;overscroll-behavior:contain}
#aboutDialog[open]{opacity:1;transform:translateY(0)}
#aboutDialog::backdrop{background:rgb(15 12 9 / .46);opacity:0;transition:opacity 360ms ease,display 360ms allow-discrete,overlay 360ms allow-discrete}
#aboutDialog[open]::backdrop{opacity:1}
@starting-style{#aboutDialog[open]{opacity:0;transform:translateY(12px)}#aboutDialog[open]::backdrop{opacity:0}}
.about-sheet{position:relative;isolation:isolate;filter:drop-shadow(0 2px 1px #25190f55) drop-shadow(3px 18px 15px #0007);--paper-edge:polygon(1% .6%,5% .4%,9% .65%,14% .25%,19% .45%,25% .2%,31% .55%,38% .15%,44% .45%,51% .2%,58% .5%,65% .1%,73% .4%,81% .15%,88% .5%,94% .2%,99.2% .65%,99.5% 5%,99.1% 11%,99.6% 18%,99.3% 25%,99.7% 33%,99.25% 41%,99.65% 49%,99.3% 57%,99.7% 65%,99.2% 73%,99.6% 81%,99.2% 89%,99.55% 95%,99% 99.1%,94% 99.5%,88% 99.15%,81% 99.65%,74% 99.3%,66% 99.7%,58% 99.35%,50% 99.75%,42% 99.4%,34% 99.7%,26% 99.3%,18% 99.65%,11% 99.3%,5% 99.6%,.6% 99.1%,.35% 94%,.7% 88%,.2% 81%,.6% 74%,.25% 66%,.65% 58%,.15% 50%,.55% 42%,.2% 34%,.65% 26%,.25% 18%,.7% 11%,.3% 5%)}
.about-sheet::before,.about-sheet::after{content:'';position:absolute;inset:0;clip-path:var(--paper-edge);pointer-events:none}
/* A thin darker cut edge and grazing light give the cotton sheet physical depth. */
.about-sheet::after{z-index:-2;transform:translate(.6px,1.6px);background:#b4a38a}
.about-sheet::before{z-index:-1;background:linear-gradient(103deg,#fff9eb60,transparent 7%,transparent 93%,#8b71591c),linear-gradient(0deg,#9d806128,transparent 5%,transparent 96%,#ffffff60),radial-gradient(ellipse at 2% 48%,#9c79501a,transparent 22%),#f2ebdd url('assets/about-paper.webp') center/100% 100% no-repeat;box-shadow:inset 0 0 16px #9e81552e,inset 2px 2px 3px #fffdf3b0,inset -2px -3px 4px #85705430}

/* Keep controls outside the scrolling text area, including in short landscape frames. */
#aboutDialog{width:min(680px,calc(100% - 48px));max-height:calc(100dvh - 40px);overflow:hidden;padding:18px}
.about-sheet{height:min(790px,calc(100dvh - 76px));display:grid;grid-template-rows:auto minmax(0,1fr) auto;perspective:1200px}
.about-header{position:relative;padding:32px 74px 20px}
.about-header h1{margin:0;text-align:center;font:400 30px/1.25 Georgia,serif;letter-spacing:.025em;color:#4b3928}
#aboutClose{position:absolute;right:16px;top:16px;z-index:2;display:grid;place-items:center;width:44px;height:44px;padding:0;border:1px solid #8d79594d;border-radius:50%;background:#f8f3e8e8;color:#65513a;cursor:pointer;box-shadow:0 2px 6px #48372512;font:32px/1 Georgia,serif;touch-action:manipulation}
.about-content{position:relative;min-height:0;overflow-y:auto;overflow-x:hidden;padding:10px 52px 20px;font:19px/1.7 Georgia,serif;overflow-wrap:anywhere;overscroll-behavior-y:contain;touch-action:pan-y;scrollbar-width:thin;scrollbar-color:#a89472 transparent}
.about-page[hidden]{display:none}.about-page{transform-origin:0 50%;backface-visibility:hidden}
.about-page p{margin:0 0 1.15em}.about-page p:last-child{margin-bottom:0}
.about-pagination{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:18px 36px 26px}
.about-pagination button{min-width:106px;min-height:44px;border:1px solid #90795370;border-radius:3px;background:#fff9ed75;color:#57412c;padding:8px 12px;font:16px/1.3 Georgia,serif;cursor:pointer;touch-action:manipulation}
.about-pagination button:disabled{opacity:.35;cursor:default}
#aboutCounter{font:15px/1.3 Georgia,serif;color:#79664e;white-space:nowrap;font-variant-numeric:tabular-nums}
#aboutClose:hover,.about-pagination button:not(:disabled):hover{background:#fffaf0;border-color:#8d7959}
#aboutClose:focus-visible,.about-content:focus-visible,.about-pagination button:focus-visible{outline:2px solid #806039;outline-offset:3px}
@media(max-width:767px){#aboutDialog{width:calc(100% - 12px);padding:8px;max-height:calc(100dvh - 16px)}.about-sheet{height:calc(100dvh - 32px);max-height:900px}.about-header{padding:30px 62px 18px}.about-header h1{font-size:28px}.about-content{padding:8px 28px 20px;font-size:19px}.about-pagination{padding:16px 22px 22px;gap:8px}.about-pagination button{min-width:96px;padding:8px}#aboutClose{right:12px;top:12px}}
@media(max-height:480px){.about-header{padding-top:20px;padding-bottom:12px}.about-header h1{font-size:25px}.about-pagination{padding-top:8px;padding-bottom:16px}}
@media(prefers-reduced-motion:reduce){#aboutDialog,#aboutDialog::backdrop,.portrait-lift{transition:none!important;transform:none!important}}

/* Auto margins centre short blocks and collapse to zero when text needs scrolling. */
.about-content{display:flex;flex-direction:column}
.about-page{flex:0 0 auto;width:100%;max-width:540px;margin:auto;text-align:left}
.about-page-centered{text-align:center;text-wrap:pretty}

/* Reference composition: six textured ink impressions, no extra rotation or rearrangement. */
.about-paw-trail{position:absolute;pointer-events:none;user-select:none;z-index:1}
.about-paw-trail[hidden]{display:none}
.about-paw-trail img{position:absolute;opacity:0;pointer-events:none;animation:about-paw-step 420ms ease-out both;animation-delay:var(--step);mix-blend-mode:multiply;--ink:.72}
.about-paw-trail img:nth-child(1){left:1.19550%;top:64.19530%;width:21.23769%;height:30.74141%;--step:100ms;}
.about-paw-trail img:nth-child(2){left:22.64416%;top:63.65280%;width:19.54993%;height:31.10307%;--step:350ms;}
.about-paw-trail img:nth-child(3){left:23.34740%;top:31.82640%;width:19.83122%;height:26.85353%;--step:600ms;}
.about-paw-trail img:nth-child(4){left:43.81153%;top:36.16637%;width:21.58931%;height:25.40687%;--step:850ms;}
.about-paw-trail img:nth-child(5){left:53.79747%;top:1.71790%;width:18.91702%;height:28.02893%;--step:1100ms;}
.about-paw-trail img:nth-child(6){left:73.20675%;top:4.61121%;width:23.41772%;height:26.58228%;--step:1350ms;}
@keyframes about-paw-step{from{opacity:0}to{opacity:var(--ink)}}
@media(prefers-reduced-motion:reduce){.about-paw-trail img{animation:none;opacity:var(--ink)}}

/* Gentle depth cue: the clipped original portrait approaches the viewer. */
.portrait-guide{position:absolute;left:48.7%;top:19.8%;width:10%;height:18%;transform:rotate(180deg);z-index:4;overflow:visible;pointer-events:none;opacity:0;visibility:hidden;transition:opacity 650ms ease,visibility 650ms}
#journey[data-mobile=true] .portrait-guide{left:31.5%;top:30.7%;width:25%;height:11.5%}
#tablePlane[data-portrait-guide=true] .portrait-guide{opacity:1;visibility:visible}
.guide-trail path{fill:none;stroke:#ffcd78;stroke-width:2.2;stroke-linecap:round}
.guide-spark{fill:#ffe5ad;stroke:#ffdc95;stroke-width:1.4}
.portrait-lift{transform-origin:50.5% 48.4%}
#journey[data-mobile=true] .portrait-lift{transform-origin:36% 49%}
#tablePlane[data-portrait-guide=true] .portrait-lift{animation:portrait-invitation-depth 3.6s ease-in-out infinite}
@keyframes portrait-invitation-depth{0%,100%{transform:scale(1);filter:brightness(1)}50%{transform:scale(1.025);filter:brightness(1.055) drop-shadow(0 2px 3px #dcb87a30)}}
@media(prefers-reduced-motion:reduce){#tablePlane[data-portrait-guide=true] .portrait-lift{animation:none}.portrait-guide{transition:none}.guide-spark,.guide-trail{display:none}}

/* Only the reading ink fades: the original paper stays visible underneath. */
@media(max-width:767px){
  .about-content{align-self:start;height:100%}
  .about-content[data-more-below=true]{mask-image:linear-gradient(to bottom,#000 calc(100% - var(--reading-fade,22px)),transparent 100%);-webkit-mask-image:linear-gradient(to bottom,#000 calc(100% - var(--reading-fade,22px)),transparent 100%)}
}

@media(max-width:767px){
  .about-content[data-tease-last-line=true]{align-self:center}
  .about-content[data-tease-last-line=true] .about-page{margin-block:0}
}

/* One title for the whole three-sheet letter, matching the book's paper tint. */
.about-sheet::before{filter:url(#aboutBookPaperColor)}
.about-sheet:not([data-page="0"]) .about-header{padding:0;min-height:64px}
.about-header h1[hidden]{display:none}
#aboutClose{background:#efdfc8ed}

/* A single shared ornament slot keeps all three engravings aligned. */
.about-sheet .about-header{height:224px;min-height:224px;padding:32px 74px 20px}
.about-celestial{display:none;position:absolute;left:50%;top:86px;transform:translateX(-50%);width:124px;height:124px;z-index:1;pointer-events:none;user-select:none;mix-blend-mode:multiply;opacity:.8;object-fit:contain;filter:none;border:0;box-shadow:none}
.about-sheet[data-page="0"] .about-celestial-sun,.about-sheet[data-page="1"] .about-celestial-moon,.about-sheet[data-page="2"] .about-celestial-constellation{display:block}
@media(max-width:767px){
 .about-sheet .about-header{height:190px;min-height:190px;padding:30px 62px 18px}
 .about-celestial{top:78px;width:96px;height:96px}
}
@media(max-height:480px){
 .about-sheet .about-header{height:128px;min-height:128px;padding-top:20px;padding-bottom:12px}
 .about-celestial{top:58px;width:56px;height:56px}
}

/* Optical balance: a slightly larger sun and a closer closing composition. */
.about-celestial-sun{width:140px;height:140px}
.about-celestial-constellation{top:98px}
.about-page-centered{position:relative;top:-42px}
@media(max-width:767px){
 .about-celestial-sun{width:108px;height:108px}
 .about-celestial-constellation{top:90px}
}
@media(max-height:480px){
 .about-celestial-sun{width:64px;height:64px}
 .about-celestial-constellation{top:64px}
 .about-page-centered{top:-10px}
}

/* The actual desktop book paper: same fibres, foxing and quiet reading centre.
   Crop only the right-hand sheet; never bring its binding or cover into About. */
.about-sheet::before{
 background:#ead8b7 url('assets/open-book-blank.webp') 83.17% 43.65% / 257.23% 115.46% no-repeat;
 filter:none;
 box-shadow:inset 0 0 10px #8d653c26,inset 1px 1px 2px #fff4dc80;
}
