/* 喀拉峻 · the story inside the book. A day on the grassland as a procession of photographs walking out of
   the haze along the ridge (after Maison Vell's Runway Lookbook), a tent door that unzips onto the Milky Way,
   and a colophon. Everything sits on the book's own paper. */
.kl { --paper: #F4F2ED; --ink: #1C1A17; --ink2: #3B3731; --mid: #8d8b86; --hair: rgba(28,26,23,.16);
  --kl-serif: "Newsreader", "Noto Serif SC", "Songti SC", serif; --kl-sans: "Inter Tight", "Noto Sans SC", system-ui, sans-serif;
  --e: cubic-bezier(.22,.61,.36,1); color: var(--ink); }
.kl section { position: relative; }
.kl .stg { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; }
.kl .kl-in { position: absolute; inset: 0; transform-origin: 50% 40%; }
.kl-eb { font: 600 11px/1 var(--kl-sans); letter-spacing: .22em; color: var(--acc); }

/* ---------- 1 · the procession ---------- */
.kl-pr .stg { background: var(--paper); }
.kl-hero { position: absolute; inset: 0; z-index: 5; transform-origin: 50% 40%; }
/* the photographs' paper haze hides the book's grain, so the grain is laid once more over the whole stage */
.kl-grain { position: absolute; inset: 0; z-index: 4; pointer-events: none; background: url("/lab/shelf/grain.png") 0 0 / 220px 220px; }
.kl-land { position: absolute; left: 0; top: 0; opacity: 0; transform-origin: 50% 40%; touch-action: pan-y; user-select: none; -webkit-user-select: none; }
.kl-land.drag { cursor: grabbing; }
.kl-ground { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.kl-ground path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.kl-ground .far { stroke: rgba(28,26,23,.14); stroke-width: 1.2; }
.kl-ground .far2 { stroke: rgba(28,26,23,.2); stroke-width: 1.2; }
.kl-ground .trail { stroke: rgba(28,26,23,.32); stroke-width: 1.4; stroke-dasharray: 2 7; }
.kl-ground .tick { stroke: rgba(28,26,23,.28); stroke-width: 1.1; }
.kl-wx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.kl-line { position: absolute; inset: 0; }
.kl-c { position: absolute; left: 0; top: 0; margin: 0; transform-origin: 50% 100%; cursor: pointer; }
.kl-c .ph { position: absolute; inset: 0; overflow: hidden; background: #E4E0D6; }
.kl-c img, .kl-c video { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.kl-c .hz { position: absolute; inset: 0; background: var(--paper); opacity: 0; }
.kl-c .sh { position: absolute; left: 8%; right: 8%; bottom: -2.4%; height: 4.4%; border-radius: 50%; background: radial-gradient(closest-side, rgba(60,50,35,.26), rgba(60,50,35,0)); }
.kl-when { position: absolute; left: 34px; bottom: 30px; z-index: 200; pointer-events: none; display: flex; align-items: flex-end; gap: 14px; }
.kl-when p { font: 500 11px/1 var(--kl-sans); letter-spacing: .2em; color: var(--mid); padding-bottom: 10px; }
.kl-when .win { height: 76px; overflow: hidden; }
.kl-when .trk b { display: block; height: 76px; font: 500 64px/76px var(--kl-serif); color: var(--acc); }

.kl-rail { position: absolute; right: 0; top: 0; bottom: 0; width: min(30vw, 420px); z-index: 3; background: var(--paper); border-left: 1px solid var(--hair); padding: 18vh 44px 0; opacity: 0; transform-origin: 50% 40%; }
.kl-list { position: relative; margin-top: 34px; height: 56vh; overflow: hidden; }
.kl-it { position: absolute; left: 0; right: 0; top: 0; height: 15vh; }
.kl-it .no { font: 500 12px/1 var(--kl-sans); letter-spacing: .14em; color: var(--acc); }
.kl-it h3 { margin-top: 10px; font: 500 clamp(22px, 2vw, 30px)/1.2 var(--kl-serif); letter-spacing: .1em; }
.kl-it p { margin-top: 8px; font: 400 14px/1.85 var(--kl-serif); letter-spacing: .04em; color: var(--ink2); max-width: 20em; }
.kl-count { position: absolute; left: 44px; bottom: 30px; font: 500 12px/1 var(--kl-sans); letter-spacing: .16em; color: var(--mid); }
.kl-count b { font: 500 15px/1 var(--kl-serif); color: var(--ink); font-variant-numeric: tabular-nums; }

/* ---------- 2 · inside the tent ---------- */
/* the drawing is a 1000 × 700 box that covers the page; the night sits in the door, under the flaps */
.kl-tb { position: absolute; left: 50%; top: 53%; width: min(100vw, 128vh); aspect-ratio: 1000 / 700; transform: translate(-50%, -50%) scale(var(--zoom, 1)); transform-origin: 50% 80%; }
.kl-tb > svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.kl-sky { position: absolute; left: 31%; top: 24.286%; width: 38%; height: 67.143%; overflow: hidden; background: #141a2c; clip-path: polygon(50% 0%, 100% 100%, 0% 100%); }
.kl-sky video { position: absolute; inset: -4%; width: 108%; height: 108%; object-fit: cover; }
.kl-sky::after { content: ""; position: absolute; inset: 0; background: linear-gradient(rgba(10,14,28,.55), rgba(10,14,28,.1) 55%, rgba(10,14,28,0)); }
.kl-tb path { fill: none; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.kl-tb .pole { stroke: var(--ink); stroke-width: 3; }
.kl-tb .seam { stroke: rgba(28,26,23,.22); stroke-width: 1; stroke-dasharray: 3 6; }
.kl-tb .fold { stroke: rgba(28,26,23,.2); stroke-width: 1.2; }
.kl-tb .pocket { stroke: rgba(28,26,23,.45); stroke-width: 1.3; fill: rgba(28,26,23,.03); }
.kl-tb .floor { stroke: rgba(28,26,23,.5); stroke-width: 1.4; }
.kl-tb .bag { stroke: var(--acc); stroke-width: 1.8; fill: rgba(217,72,46,.07); }
.kl-tb .boot { stroke: var(--ink); stroke-width: 1.3; fill: rgba(28,26,23,.06); }
.kl-tb .door { stroke: var(--ink); stroke-width: 1.8; }
.kl-tb .flap { fill: var(--paper); stroke: var(--ink); stroke-width: 1.6; }
.kl-tb .teeth { stroke: var(--acc); stroke-width: 3; stroke-dasharray: 1.5 3.5; stroke-linecap: butt; }
.kl-tb .pull path { stroke: var(--ink); stroke-width: 1.5; fill: var(--acc); }
.kl-tb .pull circle { fill: none; stroke: var(--ink); stroke-width: 1.5; }
.kl-tb .str { stroke: rgba(28,26,23,.55); stroke-width: 1; }
.kl-tb .lamp { stroke: var(--ink); stroke-width: 1.4; fill: rgba(242,161,90,.35); }
.kl-tb .bulb { fill: #F2A15A; }
.kl-tb .glow { mix-blend-mode: normal; }
/* a falling star crosses the door now and then, once it is open */
.kl-sky .meteor { position: absolute; left: 20%; top: 14%; width: 22%; height: 1.5px; background: linear-gradient(90deg, rgba(255,255,255,0), rgba(255,255,255,.95)); transform: rotate(24deg); opacity: 0; }
.kl-sky .m2 { left: 48%; top: 30%; width: 16%; }
.open .kl-sky .meteor { animation: klmeteor 7s 1.2s infinite cubic-bezier(.3,0,.2,1); }
.open .kl-sky .m2 { animation-delay: 4.6s; animation-duration: 9s; }
@keyframes klmeteor { 0% { opacity: 0; transform: rotate(24deg) translateX(-40%); } 3% { opacity: 1; } 9% { opacity: 0; transform: rotate(24deg) translateX(120%); } 100% { opacity: 0; transform: rotate(24deg) translateX(120%); } }
.kl-pre { position: absolute; left: 7vw; top: 22vh; writing-mode: vertical-rl; font: 500 clamp(26px, 2.6vw, 42px)/1.6 var(--kl-serif); letter-spacing: .3em; opacity: 0; }
.kl-log { position: absolute; left: 7vw; top: 26vh; white-space: nowrap; pointer-events: none; }
.kl-log p { opacity: 0; font: 400 clamp(17px, 1.5vw, 22px)/2.3 var(--kl-serif); letter-spacing: .16em; color: var(--ink); }

/* ---------- 3 · colophon ---------- */
.kl-end .kl-in { display: grid; grid-template-columns: 1fr auto; gap: 6vw; align-items: center; padding: 0 9vw; }
.kl-e3 h2 { margin-top: 22px; font: 500 clamp(44px, 5.4vw, 92px)/1.18 var(--kl-serif); letter-spacing: .1em; }
.kl-ep { margin-top: 28px; max-width: 24em; font: 400 15px/2 var(--kl-serif); letter-spacing: .05em; color: var(--ink2); }
.kl-colo { margin-top: 44px; display: flex; align-items: center; gap: 14px; font: 500 11px/1.6 var(--kl-sans); letter-spacing: .2em; color: var(--mid); }
.kl-seal { display: inline-block; writing-mode: vertical-rl; background: var(--acc); color: var(--paper); font: 600 16px/1.15 var(--kl-serif); font-style: normal; letter-spacing: .08em; padding: 8px 6px; border-radius: 2px; }
.kl-e3 > * { opacity: 0; transform: translateY(18px); transition: opacity 1s var(--e), transform 1s var(--e); }
.kl-e3 > :nth-child(2) { transition-delay: .15s; } .kl-e3 > :nth-child(3) { transition-delay: .3s; } .kl-e3 > :nth-child(4) { transition-delay: .45s; }
.on .kl-e3 > * { opacity: 1; transform: none; }
.kl-pair { position: relative; width: calc(56vh * 4 / 3 + 6vh); height: 76vh; }
.kl-pair figure { position: absolute; margin: 0; }
.kl-pair .ph { overflow: hidden; background: #E4E0D6; clip-path: inset(100% 0 0 0); transition: clip-path 1.2s cubic-bezier(.7,0,.2,1) .3s; }
.kl-pair img { display: block; width: 100%; height: 100%; object-fit: cover; transform: scale(1.25); transition: transform 1.8s var(--e) .3s; }
.on .kl-pair .ph { clip-path: inset(0); }
.on .kl-pair img { transform: none; }
.kl-e1 { left: 0; top: 4vh; width: calc(48vh * 4 / 3); }
.kl-e1 .ph { height: 48vh; }
.kl-e1 figcaption { margin-top: 12px; font: 500 11.5px/1.4 var(--kl-sans); letter-spacing: .12em; color: var(--ink2); }
.kl-e2 { right: 0; bottom: 0; width: 22vh; }
.kl-e2 .ph { height: calc(22vh * 4 / 3); transition-delay: .7s; }
.kl-e2 img { transition-delay: .7s; }

@media (max-width: 767px) {
  .kl-rail { left: 0; right: 0; top: auto; width: auto; height: 28vh; border-left: 0; border-top: 1px solid var(--hair); padding: 18px 24px 0; }
  .kl-list { margin-top: 12px; height: 15vh; overflow: hidden; }
  .kl-it { height: 15vh; }
  .kl-it h3 { font-size: 20px; margin-top: 6px; }
  .kl-it p { font-size: 13px; line-height: 1.7; }
  .kl-count { left: auto; right: 24px; top: 18px; bottom: auto; }
  .kl-when { left: 20px; bottom: auto; top: 64px; }
  .kl-when .win { height: 48px; } .kl-when .trk b { height: 48px; font-size: 40px; line-height: 48px; }
  .kl-when p { display: none; }
  .kl-tb { width: 150vw; }
  .kl-pre { left: 18px; top: 12vh; font-size: 22px; }
  .kl-log { left: 0; right: 0; top: auto; bottom: 7vh; width: auto; text-align: center; }
  .kl-log p { font-size: 16px; line-height: 2; }
  .kl-end .kl-in { grid-template-columns: 1fr; gap: 26px; padding: 70px 26px 40px; align-content: center; }
  .kl-pair { order: -1; width: 100%; height: 38vh; }
  .kl-e1 { top: 0; width: 80%; } .kl-e1 .ph { height: 28vh; }
  .kl-e1 figcaption { display: none; }
  .kl-e2 { width: 30%; } .kl-e2 .ph { height: 17vh; }
  .kl-e3 h2 { font-size: 34px; margin-top: 14px; }
  .kl-ep { margin-top: 14px; font-size: 14px; }
  .kl-colo { margin-top: 20px; }
}
@media (prefers-reduced-motion: reduce) { .kl-e3 > *, .kl-pair .ph, .kl-pair img { transition: none; } }
