/* ===== The art on the page: taped pins, full-bleed plates, small insets, one red-pen ring ===== */
.plate img{display:block;width:100%;height:auto}
.plate-cap{margin-top:10px;font-family:var(--mono);font-size:11px;line-height:1.5;letter-spacing:.1em;text-transform:uppercase;color:var(--leaf-soft)}

/* pin: a photo on a white mount, taped at the top, tilted, hung beside the text */
.plate-pin{float:right;width:min(40%,300px);margin:8px 0 22px clamp(22px,3vw,40px)}
.plate-pin .plate-frame{position:relative;background:#fff;padding:8px 8px 10px;rotate:var(--tilt,2deg);
  box-shadow:0 1px 0 rgba(0,0,0,.06),0 14px 30px -12px rgba(40,10,0,.45)}
.plate-pin .tape{position:absolute;z-index:1;top:-12px;left:50%;width:84px;height:24px;margin-left:-42px;background:rgba(240,226,190,.84);rotate:-4deg;box-shadow:0 1px 2px rgba(0,0,0,.08)}
.plate-pin .plate-cap{margin-top:14px;text-align:center}

/* full: a plate across the whole page, edge to edge, caption back in the margin */
.plate-full{margin:clamp(22px,3vw,34px) calc(var(--leaf-px) * -1) clamp(24px,3vw,32px)}
.plate-full .plate-frame{aspect-ratio:3/2;overflow:hidden;background:var(--paper-2)}
.plate-full img{height:100%;object-fit:cover}
.plate-full .plate-cap{padding:0 var(--leaf-px)}

/* inset: a small framed figure set into the text after the opening paragraph */
.plate-inset{float:left;width:min(34%,230px);margin:6px clamp(20px,2.8vw,32px) 14px 0}
.plate-inset .plate-frame{border:1px solid var(--leaf-line);padding:6px;background:var(--paper)}

@media (max-width:640px){
  .plate-pin{float:none;width:78%;margin:24px auto 28px}
  .plate-inset{float:none;width:72%;display:block;margin:8px auto 1.4em}
  .plate-inset .plate-cap{margin:10px 0 0;text-align:center}
}

/* endings: the stamp thumps onto the top corner of the plate */
.is-ending .end-stamp{position:relative;z-index:2;margin-bottom:-30px;background:color-mix(in srgb,var(--paper) 86%,transparent)}
.is-ending .plate-full{margin-top:0}

/* the red pen: one word per page gets circled */
.pen{position:relative;white-space:nowrap;margin:0 .14em}
.pen::after{content:"";position:absolute;left:-.26em;right:-.26em;top:-.2em;bottom:-.24em;border:2px solid var(--loud);border-radius:50%;rotate:-3deg;pointer-events:none}
html.motion .pen::after{animation:cyoaPen .7s var(--ease-pen) .95s both}
@keyframes cyoaPen{from{clip-path:inset(0 100% 0 0)}to{clip-path:inset(0 0 0 0)}}

/* the 3D turn measures pins upright, then paints the tilt back in */
.leaf.is-capturing .plate-frame,.leaf.is-capturing .tape{rotate:none!important}

@media (prefers-reduced-motion: reduce){html.motion .pen::after{animation:none}}
