
#detail[data-room="paper"] {
  --world-floor: #143b35;
  --world-wash: #317764;
  --world-ink: #fff2d5;
  --world-accent: #ffd478;
}
#detail[data-room="paper"] .room-atmosphere {
  background:
    radial-gradient(ellipse at 81% 35%, #54836a 0, #296556 28%, transparent 66%),
    linear-gradient(118deg, #103b34, #184f43 57%, #29604c);
}
#detail[data-room="paper"] .room-atmosphere > * { display: none; }
#paper-panel.post-room {
  --post-ink: var(--world-ink, #233a26);
  --post-accent: var(--world-accent);
  --post-rule: color-mix(in srgb, var(--post-ink) 37%, transparent);
  display: block;
  min-width: 0;
  width: 100%;
  margin: 0;
  padding: 0;
  background: transparent;
  color: var(--post-ink);
  font-family: Archivo,Arial,sans-serif;
}
.post-desk {
  position: relative;
  min-height: calc(100svh - var(--room-bar-h,80px));
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(0,1.14fr);
  grid-template-rows: 1fr auto auto 1fr auto;
  grid-template-areas: ". book" "intro book" "tools book" ". book" "index book";
  column-gap: clamp(15px,3vw,80px);
  padding: clamp(28px,4.5svh,70px) var(--pad) max(27px,5svh);
  min-width: 0;
}
.post-intro { grid-area: intro; min-width: 0; position: relative; z-index: 1; }
#paper-panel .post-byline {
  display: flex;
  gap: .77em;
  align-items: center;
  margin: 0 0 clamp(18px,2.8svh,32px);
  font: 610 clamp(12px,.98vw,16px)/1.3 Archivo,Arial,sans-serif;
}
.post-byline::before { content: ""; width: 1.9em; height: 1px; background: var(--post-accent); }
#paper-panel h2.post-title {
  margin: 0;
  font: 900 clamp(42px, min(9.3vw,17svh), 178px)/.8 BarlowPoster,Impact,sans-serif;
  letter-spacing: -.048em;
  text-transform: uppercase;
  overflow-wrap: normal;
}
.post-title span { display: block; }
.post-title span + span { margin: .025em 0 0 .19em; font-size: 1.32em; }
#paper-panel p.post-copy {
  margin: clamp(20px,3.1svh,39px) 0 0;
  max-width: 32ch;
  font: 430 clamp(15px,1.28vw,23px)/1.42 Archivo,Arial,sans-serif;
  letter-spacing: -.025em;
}
.post-tools {
  grid-area: tools;
  justify-self: start;
  display: flex;
  position: relative;
  z-index: 1;
  align-items: center;
  gap: 12px;
  margin-top: clamp(17px,2.8svh,34px);
}
.post-forward {
  display: inline-flex;
  align-items: center;
  position: relative;
  min-height: 50px;
  overflow: hidden;
  padding-inline: 12px 19px;
  gap: 12px;
  color: #1c3025;
  background: #f6cb76;
  font: 620 14px/1.2 Archivo,Arial,sans-serif;
  letter-spacing: -.018em;
}
.post-forward::after {
  content: "";
  position: absolute;
  top: 0;
  right: 0;
  width: 10px;
  height: 10px;
  background: linear-gradient(45deg,#b3944d 49%,var(--world-floor) 51%);
  transition: width .25s,height .25s;
}
.post-stamp-icon,.post-action-arrow { display: grid; place-items: center; }
.post-stamp-icon svg { height: 24px; width: 27px; }
.post-action-arrow svg,.post-back svg { height: 18px; width: 18px; }
.post-action-arrow { transition: transform .25s ease; }
.post-return .post-action-arrow { transform: rotate(180deg); }
.post-back {
  display: grid;
  min-width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--post-rule);
  border-radius: 50%;
}
.post-back svg { transform: rotate(180deg); }
.post-back:disabled { visibility: hidden; }
#paper-panel :is(button,input):focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }
#paper-panel .post-forward:focus-visible { outline-color: var(--post-ink); }
.post-index {
  grid-area: index;
  display: flex;
  gap: clamp(3px,.53vw,11px);
  align-self: end;
  width: min(100%,310px);
  border-top: 1px solid var(--post-rule);
}
.post-index button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45em;
  min-width: 42px;
  min-height: 44px;
  font: 530 12px/1 Archivo,Arial,sans-serif;
  font-variant-numeric: tabular-nums;
}
.post-index button:first-child { justify-content: start; }
.post-index button::before {
  content: "";
  width: 5px;
  height: 5px;
  border: 1px solid currentColor;
  transform: rotate(45deg);
}
.post-index button[aria-current]::before { background: var(--post-ink); }
.post-index button[aria-current] { font-weight: 720; color: var(--post-accent); }
.post-rest {
  grid-area: book;
  position: relative;
  display: grid;
  grid-template-rows: minmax(0,1fr) auto;
  min-width: 0;
  margin: 0;
}
.post-canvas {
  display: grid;
  position: relative;
  align-content: center;
  justify-items: center;
  min-width: 0;
  perspective: 1800px;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y pinch-zoom;
}
.post-book {
  position: relative;
  width: min(80%, calc(65svh * .77273), 530px);
  aspect-ratio: 17 / 22;
  perspective: 1500px;
  transform-origin: center;
  transition: width .62s cubic-bezier(.31,.065,.16,1), transform .62s cubic-bezier(.31,.065,.16,1);
}
.post-room[data-open-book="true"] .post-book {
  width: min(47%, calc(65svh * .77273), 530px);
  transform: translateX(49%);
}
.post-pageblock,.post-art,.post-sheet,.post-surface,.post-verso { position: absolute; inset: 0; }
.post-pageblock {
  transform: translate(4px,4px);
  border-radius: 1px 3px 3px 1px;
  background: repeating-linear-gradient(0deg,#e8e2ce 0 1px,#b1ac95 1px 2px,#f4eedc 2px 4px);
  box-shadow: 1px 2px 0 #827c60,4px 7px 9px -2px #27361258,12px 30px 29px -6px #3c4b2252;
}
.post-art,.post-face,.post-reverse,.post-verso { border-radius: 1px 3px 3px 1px; background: #fffdf3; }
.post-art { overflow: hidden; }
#paper-panel .post-art img,#paper-panel .post-face img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  object-fit: contain;
  pointer-events: none;
}
.post-art::after,.post-face::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg,#46453733 0%,#fffbea40 1%,#665c411f 2.5%,transparent 5%);
}
.post-room[data-open-book="true"] .post-art::after {
  background: linear-gradient(90deg,#6e62412d 0%,#ad9c7c11 5%,transparent 15%);
}
.post-verso {
  visibility: hidden;
  transform: translateX(-99.5%);
  border-radius: 3px 1px 1px 3px;
  box-shadow: -1px 2px 0 #e7e1cb,-3px 5px 1px #a2aa8d,-7px 16px 24px #33462036;
}
.post-verso,.post-reverse {
  background: linear-gradient(91deg,#f4f1e8,#fffdf9 34%,#f9f8ef 72%,#eeeadf 94%,#c6bda9);
}
.post-room[data-verso="true"] .post-verso { visibility: visible; }
.post-sheet {
  z-index: 1;
  transform-origin: left center;
  transform-style: preserve-3d;
  pointer-events: none;
}
.post-face,.post-reverse { position: absolute; inset: 0; backface-visibility: hidden; }
.post-face { transform: translateZ(.2px); overflow: hidden; }
.post-reverse { transform: rotateY(180deg); }
.post-surface {
  z-index: 2;
  background: transparent;
  cursor: pointer;
  touch-action: pan-y pinch-zoom;
  -webkit-tap-highlight-color: transparent;
}
.post-curl {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 0;
  height: 0;
  border-radius: 1px;
  background: linear-gradient(135deg,#e6e5d9,#fffef3 45%,#b2a888 54%,transparent 56%);
  transition: width .2s,height .2s;
}
.post-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0;
  min-height: 45px;
  border-top: 1px solid var(--post-rule);
  color: var(--post-ink);
  font: 600 13px/1.3 Archivo,Arial,sans-serif;
}
.post-page-number { font-size: 12px; font-weight: 450; color: var(--post-accent); }
.post-caption-control { justify-content: flex-end; margin-left: auto; }
.post-caption-control,.post-reader-tools button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding-inline: 3px;
  white-space: nowrap;
  font: 650 13px/1.2 Archivo,Arial,sans-serif;
  font-variant-numeric: tabular-nums;
}
.post-caption-control svg { width: 16px; height: 16px; }
.post-caption-control:hover,.post-reader-tools button:hover { color: var(--post-accent); }
.post-reader {
  position: fixed;
  inset: 0;
  margin: auto;
  padding: 0;
  border: 1px solid #5b786a;
  width: min(96vw,1180px);
  height: min(96dvh,1000px);
  max-width: 100%;
  max-height: 100dvh;
  background: #183b32;
  color: #fff2d5;
}
.post-reader[open] { display: grid; grid-template-rows: auto minmax(0,1fr); }
.post-reader::backdrop { background: #0c1d18c9; }
.post-reader-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 14px;
  min-width: 0;
  padding: 3px clamp(8px,2vw,20px);
  border-bottom: 1px solid #6b8376;
}
.post-reader-tools h3 { font: 650 clamp(15px,2vw,20px)/1.1 Archivo,Arial,sans-serif; margin: 0 auto 0 0; }
.post-reader-tools .post-detail-control { color: #faca76; }
.post-reader-controls { display: flex; gap: 16px; }
.post-reading-area {
  overflow: auto;
  min-width: 0;
  min-height: 0;
  container-type: size;
  background: #294b3e;
}
.post-reading-column {
  display: grid;
  place-items: center;
  min-width: 100%;
  width: max-content;
  min-height: 100%;
  padding: 12px;
}
.post-reading-column img {
  display: block;
  width: auto;
  height: auto;
  margin: 0;
  max-width: calc(100cqw - 24px);
  max-height: calc(100cqh - 24px);
  object-fit: contain;
}
.post-reader[data-zoomed="true"] .post-reading-column button { cursor: zoom-out; }
.post-reader[data-zoomed="true"] .post-reading-column img {
  width: var(--zoom-width);
  max-width: none;
  max-height: none;
}
.post-reading-column button { cursor: zoom-in; }
.post-reading-column button:focus-visible { outline: 3px solid #faca76; }
@media (hover:hover) and (pointer:fine) {
  .post-forward:hover::after { width: 15px; height: 15px; }
  .post-forward:not(.post-return):hover .post-action-arrow { transform: translateX(3px); }
  .post-back:enabled:hover { background: var(--post-ink); color: #143b35; }
  .post-index button:hover { text-decoration: underline; text-underline-offset: .3em; }
  .post-surface:hover .post-curl { width: 17px; height: 17px; }
}
@media (max-width:740px) and (min-height:481px), (max-width:599px) {
  .post-desk {
    min-height: calc(100svh - var(--room-bar-h,60px));
    grid-template-columns: minmax(0,1fr);
    grid-template-rows: auto 1fr auto;
    grid-template-areas: "intro" "book" "tools";
    row-gap: 10px;
    padding: 8px var(--pad) max(12px,env(safe-area-inset-bottom));
  }
  #paper-panel .post-byline { font-size: 11px; margin-bottom: 12px; }
  #paper-panel h2.post-title { font-size: clamp(42px,min(11.6vw,10svh),81px); line-height: .86; letter-spacing: -.035em; }
  .post-title span { display: inline-block; }
  .post-title span + span { font-size: 1em; margin: 0 0 0 .14em; }
  #paper-panel p.post-copy { max-width: 38ch; margin-top: 10px; font-size: 14px; line-height: 1.35; }
  .post-rest { align-self: stretch; }
  .post-caption { font-size: 12px; min-height: 36px; }
  .post-tools { margin: 0; flex-wrap: nowrap; gap: 5px; }
  .post-forward { gap: 8px; min-height: 44px; padding-inline: 8px 13px; font-size: 13px; }
  .post-stamp-icon svg { width: 23px; height: 21px; }
  .post-action-arrow { display: none; }
  .post-back { min-width: 38px; height: 40px; border: none; }
  .post-index {
    grid-area: tools;
    justify-self: end;
    width: auto;
    align-self: center;
    gap: 0;
    border: 0;
  }
  .post-index button { min-width: 36px; font-size: 11px; gap: 4px; }
  .post-canvas { padding: 12px 0 18px; }
  .post-book { width: min(77%, calc(max(150px, 100svh - 330px) * .69), 330px); }
  .post-room[data-open-book="true"] .post-book { width: min(47%, calc(max(150px,100svh - 330px) * .69), 330px); }
  .post-caption { gap: 8px; }
  .post-page-number { flex-shrink: 0; }
  .post-caption-text { font-size: 12px; }
  .post-reader { width: 100vw; height: 100dvh; border: 0; }
}
@media (max-width:385px) {
  .post-desk { grid-template-rows: auto 1fr auto auto; grid-template-areas: "intro" "book" "tools" "index"; row-gap: 5px; }
  .post-book { width: min(77%, calc(max(150px,100svh - 354px) * .74), 315px); }
  #paper-panel h2.post-title { font-size: clamp(32px,10vw,40px); }
  .post-index { grid-area: index; justify-self: start; }
  .post-index button { min-width: 44px; }
}
@media (max-height:600px) and (min-width:600px) {
  .post-desk {
    grid-template-columns: minmax(0,.93fr) minmax(0,1fr);
    grid-template-rows: 1fr auto auto 1fr auto;
    grid-template-areas: ". book" "intro book" "tools book" ". book" "index book";
    padding: 8px var(--pad) 12px;
    gap: 0 5vw;
  }
  #paper-panel h2.post-title { font-size: clamp(34px,min(5.8vw,10svh),65px); }
  #paper-panel .post-byline { margin-bottom: 6px; }
  #paper-panel p.post-copy { font-size: 14px; margin-top: 10px; }
  .post-tools { margin-top: 8px; }
  .post-index { grid-area: index; }
  .post-canvas { padding-block: 5px 12px; }
  .post-book { width: min(76%, calc(max(125px, 100svh - 178px) * .77273)); }
  .post-room[data-open-book="true"] .post-book { width: min(47%, calc(max(125px, 100svh - 178px) * .77273)); }
  .post-forward { min-height: 44px; }
  .post-caption { gap: 6px; }
}
@media (prefers-reduced-motion:reduce) {
  .post-book,.post-surface,.post-forward::after,.post-curl { transition: none; }
}
