/* 鹞子梁 · the story inside the book. 鹞子翻身 through the hawk's eye: a round lens set in a finely ruled attitude
   dial, rolling over from one hour of the ridge to the next. Phone first, on the book's own paper. */
.yz { --paper: #F4F2ED; --ink: #1C1A17; --ink2: #3B3731; --mid: #8d8b86; --hair: rgba(28,26,23,.18);
  --yz-serif: "Newsreader", "Noto Serif SC", "Songti SC", serif; --yz-sans: "Inter Tight", "Noto Sans SC", system-ui, sans-serif;
  --e: cubic-bezier(.22,.61,.36,1); color: var(--ink); }
.yz section { position: relative; }
.yz .stg { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.yz-hero { position: absolute; inset: 0; z-index: 5; transform-origin: 50% 40%; }
.yz-eb { font: 600 11px/1 var(--yz-sans); letter-spacing: .24em; color: var(--acc); }

/* phone: title above, instrument in the middle, readings and the line beneath */
.yz-in { position: absolute; inset: 0; opacity: 0; transform-origin: 50% 40%; display: grid; grid-template-rows: auto auto auto auto; align-content: center; justify-items: center;
  row-gap: 2.4vh; padding: 64px 20px 20px; }
.yz-tt { text-align: center; }
.yz-tt h2 { margin-top: 12px; font: 500 34px/1 var(--yz-serif); letter-spacing: .26em; margin-right: -.26em; }
.yz-sub { margin: 12px auto 0; max-width: 21em; font: 400 13.5px/1.9 var(--yz-serif); letter-spacing: .05em; color: var(--ink2); }

/* the instrument: the lens, and around it the dial */
.yz-inst { position: relative; width: calc(var(--d) * 1.36); height: calc(var(--d) * 1.36); display: grid; place-items: center; }
.yz-lens { position: relative; width: var(--d); height: var(--d); border-radius: 50%; overflow: hidden; touch-action: pan-y; cursor: grab;
  box-shadow: 0 0 0 1px rgba(28,26,23,.5), 0 30px 60px -36px rgba(30,40,70,.55); background: #DCD8CE; -webkit-tap-highlight-color: transparent; }
.yz-lens .yz-fb, .yz-lens canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.yz-lens .yz-fb { object-fit: cover; }
.yz-lens.gl.ready .yz-fb { visibility: hidden; }
.yz-dial { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.yz-dial .rim { fill: none; stroke: rgba(28,26,23,.55); stroke-width: .35; }
.yz-dial .rim2 { fill: none; stroke: rgba(28,26,23,.2); stroke-width: .25; }
.yz-dial line { stroke: rgba(28,26,23,.45); stroke-width: .25; }
.yz-dial line.mj { stroke: var(--ink); stroke-width: .45; }
.yz-dial .ticks text { font: 500 2.6px var(--yz-sans); fill: var(--mid); text-anchor: middle; letter-spacing: .05em; }
.yz-dial .ring text { font: 500 2.5px var(--yz-sans); fill: var(--ink2); letter-spacing: .3em; }
.yz-dial .ptr path { fill: var(--acc); }
.yz-dial .wing path { fill: none; stroke: rgba(255,255,255,.92); stroke-width: .55; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 .8px rgba(0,0,0,.45)); }
.yz-dial .wing circle { fill: #fff; filter: drop-shadow(0 0 .8px rgba(0,0,0,.45)); }

/* readings */
.yz-read { display: grid; grid-template-columns: 1fr 1fr 1fr; width: min(100%, calc(var(--d) * 1.2)); border-top: 1px solid var(--hair); border-bottom: 1px solid var(--hair); }
.yz-read .cell { padding: 10px 4px; text-align: center; }
.yz-read .mid { border-left: 1px solid var(--hair); border-right: 1px solid var(--hair); }
.yz-read span { display: block; font: 500 10px/1 var(--yz-sans); letter-spacing: .26em; color: var(--mid); }
.yz-read b { display: block; margin-top: 7px; font: 500 16px/1 var(--yz-serif); letter-spacing: .08em; font-variant-numeric: tabular-nums; color: var(--ink); }
.yz-read b i { font-style: normal; }
.yz-read .hour { color: var(--acc); }
.yz-cap { position: relative; width: min(100%, 24em); height: 3.8em; }
.yz-cap p { position: absolute; left: 0; right: 0; top: 0; text-align: center; font: 400 15px/1.9 var(--yz-serif); letter-spacing: .06em; color: var(--ink2);
  opacity: 0; transform: translateY(8px); transition: opacity .7s var(--e), transform .7s var(--e); }
.yz-cap p.on { opacity: 1; transform: none; transition-delay: .1s; }

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

/* desktop: the title stands to the left of the instrument, the readings and the line to its right */
@media (min-width: 768px) {
  .yz-in { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); grid-template-rows: 1fr; align-items: center; column-gap: 4.5vw; padding: 70px 5vw 40px; row-gap: 0; }
  .yz-tt { grid-column: 1; grid-row: 1; justify-self: end; text-align: left; width: min(19em, 100%); }
  .yz-tt h2 { font-size: clamp(44px, 4.2vw, 72px); letter-spacing: .18em; margin-right: 0; white-space: nowrap; }
  .yz-sub { margin: 24px 0 0; font-size: 15px; }
  .yz-inst { grid-column: 2; grid-row: 1; }
  .yz-read, .yz-cap { grid-column: 3; grid-row: 1; justify-self: start; }
  .yz-read { width: min(19em, 100%); align-self: center; margin-top: -8em; }
  .yz-read b { font-size: 20px; }
  .yz-read span { font-size: 10.5px; }
  .yz-cap { width: min(19em, 100%); align-self: center; margin-top: 6em; }
  .yz-cap p { text-align: left; font-size: 17px; }
}
@media (prefers-reduced-motion: reduce) { .yz-et > *, .yz-cap p { transition: none; } }
