/* 顶棚梁 · the story inside the book. One tall window that climbs from under the golden canopy to the cloud sea
   and the ridge, with a height rule beside it. Phone first, on the book's own paper. */
.dp { --paper: #F4F2ED; --ink: #1C1A17; --ink2: #3B3731; --mid: #8d8b86; --hair: rgba(28,26,23,.18);
  --dp-serif: "Newsreader", "Noto Serif SC", "Songti SC", serif; --dp-sans: "Inter Tight", "Noto Sans SC", system-ui, sans-serif;
  --e: cubic-bezier(.22,.61,.36,1); color: var(--ink); }
.dp section { position: relative; }
.dp .stg { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.dp-hero { position: absolute; inset: 0; z-index: 5; transform-origin: 50% 40%; }
.dp-eb { font: 600 11px/1 var(--dp-sans); letter-spacing: .24em; color: var(--acc); }

.dp-in { position: absolute; inset: 0; opacity: 0; transform-origin: 50% 40%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2.4vh; padding: 62px 18px 18px; }
.dp-tt { text-align: center; }
.dp-tt h2 { margin-top: 10px; font: 500 30px/1.1 var(--dp-serif); letter-spacing: .24em; margin-right: -.24em; }

/* the window and its height rule */
.dp-stage { position: relative; display: flex; align-items: stretch; gap: 14px; }
.dp-win { position: relative; width: var(--w); aspect-ratio: 3 / 4; overflow: hidden; background: #D9D3C6;
  box-shadow: 0 0 0 1px rgba(28,26,23,.35), 0 0 0 7px var(--paper), 0 0 0 8px rgba(28,26,23,.14), 0 34px 60px -38px rgba(60,40,10,.6); }
.dp-win .dp-fb, .dp-win canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.dp-win .dp-fb { object-fit: cover; }
.dp-win.gl.ready .dp-fb { visibility: hidden; }
.dp-rule { position: relative; width: 38px; margin: 8% 0; }
.dp-rule .track { position: absolute; right: 6px; top: 0; bottom: 0; width: 1px; background: repeating-linear-gradient(to bottom, rgba(28,26,23,.5) 0 1px, transparent 1px 9px); }
.dp-rule .mark { position: absolute; right: 2px; width: 9px; height: 9px; margin-top: -4.5px; border-radius: 50%; background: var(--acc); box-shadow: 0 0 0 3px rgba(154,113,34,.18); }
.dp-rule span { position: absolute; right: 18px; bottom: calc(var(--m) / 2 * 100%); transform: translateY(50%); writing-mode: vertical-rl; white-space: nowrap;
  font: 500 10.5px/1 var(--dp-sans); letter-spacing: .3em; color: var(--mid); transition: color .5s; }
.dp-rule span.on { color: var(--ink); }

/* the line under the window */
.dp-cap { position: relative; width: min(100%, 24em); height: 6.4em; }
.dp-cap > div { position: absolute; inset: 0; text-align: center; opacity: 0; transform: translateY(8px); transition: opacity .7s var(--e), transform .7s var(--e); }
.dp-cap > div.on { opacity: 1; transform: none; transition-delay: .12s; }
.dp-cap b { font: 600 11px/1 var(--dp-sans); letter-spacing: .3em; color: var(--acc); }
.dp-cap p { margin-top: 10px; font: 400 14.5px/1.9 var(--dp-serif); letter-spacing: .05em; color: var(--ink2); }

/* the end */
.dp-ein { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 0 28px; opacity: 0; }
.dp-et { width: min(30em, 100%); }
.dp-et h2 { margin-top: 18px; font: 500 clamp(38px, 5vw, 80px)/1.1 var(--dp-serif); letter-spacing: .16em; }
.dp-et h2 + p { margin-top: 18px; font: 400 15px/2 var(--dp-serif); letter-spacing: .05em; color: var(--ink2); }
.dp-et dl { margin-top: 24px; border-bottom: 1px solid var(--hair); }
.dp-et dl div { display: flex; justify-content: space-between; gap: 18px; padding: 9px 0; border-top: 1px solid var(--hair); }
.dp-et dt { font: 500 11.5px/1.6 var(--dp-sans); letter-spacing: .16em; color: var(--mid); white-space: nowrap; }
.dp-et dd { font: 400 14px/1.6 var(--dp-serif); letter-spacing: .04em; color: var(--acc); text-align: right; }
.dp-colo { margin-top: 28px; display: flex; align-items: center; gap: 14px; font: 500 11px/1.6 var(--dp-sans); letter-spacing: .2em; color: var(--mid); }
.dp-seal { display: inline-block; writing-mode: vertical-rl; background: var(--acc); color: var(--paper); font: 600 15px/1.15 var(--dp-serif); font-style: normal; letter-spacing: .06em; padding: 8px 6px; border-radius: 2px; }
.dp-et > * { opacity: 0; transform: translateY(16px); transition: opacity 1s var(--e), transform 1s var(--e); }
.dp-et > :nth-child(2) { transition-delay: .12s; } .dp-et > :nth-child(3) { transition-delay: .24s; } .dp-et > :nth-child(4) { transition-delay: .36s; } .dp-et > :nth-child(5) { transition-delay: .48s; }
.on .dp-et > * { opacity: 1; transform: none; }

/* desktop: the title to the left, the window in the middle, the line to the right */
@media (min-width: 768px) {
  .dp-in { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; column-gap: 5vw; padding: 70px 5vw 40px; }
  .dp-tt { justify-self: end; text-align: left; }
  .dp-tt h2 { writing-mode: vertical-rl; font-size: clamp(44px, 4.4vw, 76px); letter-spacing: .2em; margin: 22px 0 0; }
  .dp-stage { grid-column: 2; }
  .dp-cap { grid-column: 3; justify-self: start; width: min(19em, 100%); height: 9em; }
  .dp-cap > div { text-align: left; }
  .dp-cap p { font-size: 17px; }
  .dp-rule { width: 54px; }
  .dp-rule span { font-size: 11.5px; }
}
@media (prefers-reduced-motion: reduce) { .dp-et > *, .dp-cap > div { transition: none; } }
