/* The story behind Karya, its own page: the chapter basics and the five acts from site-v4, as built */
/* ── The homepage below the hero: chapters 02–10 on one long sheet of paper ──
   Four languages, each with one job: sumi ink for feeling, macro photographs for the real world, hairline technical
   drawings (mono labels, tiny red markers) for intelligence, and the product itself, drawn precisely, as the proof.
   Huge negative space; one heading and one thing to look at per screen. */
.paper { --mono: "IBM Plex Mono", ui-monospace, monospace; --red: #b3261e; --hair: rgba(23,23,21,.22); --ink-c: #171715; --ink-on: #f3ebdd; }
.paper .ink.wash { color: var(--ink); }
.ch { position: relative; max-width: 1320px; margin: 0 auto; padding: 160px 64px; }
.ch + .ch { padding-top: 40px; }
.kick { display: inline-flex; align-items: center; gap: 12px; margin: 0 0 26px; font: 500 11.5px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); }
.kick b { font-weight: 500; color: var(--ink); }
.kick::before { content: ""; width: 22px; height: 1px; background: currentColor; opacity: .6; }
.h { margin: 0; font: 500 clamp(46px, 5.2vw, 86px)/.98 var(--serif); letter-spacing: -.028em; color: var(--ink); text-wrap: balance; }
.h em { font-style: italic; font-weight: 400; }
.h .l2 { display: block; }
.lead { margin: 30px 0 0; max-width: 54ch; font: 400 18px/1.65 var(--sans); color: var(--ink-2); text-wrap: pretty; }
.prose p { margin: 0 0 18px; max-width: 52ch; font: 400 17px/1.7 var(--sans); color: var(--ink-2); text-wrap: pretty; }
.prose p em { font-family: var(--serif); font-size: 1.12em; color: var(--ink); }
.close { margin: 38px 0 0; font: italic 500 clamp(24px, 2.2vw, 32px)/1.2 var(--serif); color: var(--ink); }
.acts2 { display: flex; flex-wrap: wrap; gap: 18px; margin-top: 34px; }
.tags { margin: 18px 0 0; font: 400 12px/1.5 var(--mono); letter-spacing: .06em; color: var(--ink-3); }
/* figures: real photographs, framed by nothing; a mono caption with a hairline */
.fig { margin: 0; }
.fig img { display: block; width: 100%; height: auto; border-radius: 2px; }
.fig figcaption { display: flex; gap: 14px; align-items: baseline; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--hair); font: 400 11px/1.4 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.fig figcaption b { font-weight: 500; color: var(--ink); }

/* entrance: heading, then text, then picture, each rising a little, once */
.rise { opacity: 0; transform: translateY(22px); transition: opacity .9s var(--ease), transform 1.1s var(--ease); transition-delay: calc(var(--r, 0) * 90ms); }
.seen .rise, .rise.seen { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .rise { opacity: 1; transform: none; transition: none; } }
/* buttons below the hero paint themselves when they come into view, not on load */
.paper .ink { --pd: .15s; }
.paper .ink:not(.seen) .brush path, .paper .ink:not(.seen) .w { animation-play-state: paused; }
/* a brush stroke under a closing line, painted when it arrives */
.under { position: relative; display: inline-block; }
.under svg { position: absolute; left: -2%; bottom: -.28em; width: 104%; height: .5em; overflow: visible; color: var(--ink); opacity: .82; }
.under path { fill: none; stroke: currentColor; stroke-width: 5; stroke-linecap: round; stroke-dasharray: 1 2; stroke-dashoffset: 1; transition: stroke-dashoffset 1.1s cubic-bezier(.45,.05,.3,1) .5s; }
.seen .under path { stroke-dashoffset: 0; }

/* ── 02 · Why Karya: from the garden onto a nearly blank sheet ── */
.why { padding-top: 200px; min-height: 100vh; }
.why .diffuse { position: absolute; left: -16%; top: -30px; width: min(620px, 46vw); mix-blend-mode: multiply; opacity: .9; pointer-events: none;
  -webkit-mask: radial-gradient(closest-side, #000 62%, transparent); mask: radial-gradient(closest-side, #000 62%, transparent);
  filter: contrast(1.08) brightness(1.04); transform: translateY(20px); opacity: 0; transition: opacity 2.4s ease, transform 3s var(--ease); }
.why.seen .diffuse { opacity: .88; transform: none; }
.why .kick { margin-left: 18%; }
.why .mono { position: relative; max-width: 22ch; font-size: clamp(56px, 7.4vw, 124px); line-height: .94; margin-left: 18%; }
.why .mono .l2 { margin-left: .9em; }
.why .body { display: grid; grid-template-columns: 1fr minmax(0, 520px); gap: 80px; margin-top: 110px; align-items: start; }
.why .fig { max-width: 380px; margin-top: 8px; }
.why .close { font-size: clamp(30px, 3vw, 44px); margin-top: 70px; text-align: center; }

/* ── 02 · a guided read: the words ink in as they cross the reading line, and the picture follows the paragraph ── */
.why .read { display: grid; grid-template-columns: minmax(0, 520px) minmax(0, 620px); justify-content: space-between; gap: 80px; margin-top: 120px; align-items: start; }
.why .plate { position: sticky; top: 20vh; max-width: none; margin: 0; }
.why .plate .frames { position: relative; aspect-ratio: 16 / 10; }
.why .plate .frames img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 1.1s var(--ease); }
.why .plate .frames img.on { opacity: 1; }
.why .plate figcaption span { transition: opacity .5s; }
.why .text p { margin: 0 0 22vh; font: 400 clamp(22px, 1.75vw, 27px)/1.55 var(--sans); letter-spacing: -.005em; color: var(--ink); max-width: 30ch; text-wrap: pretty; }
.why .text p:last-child { margin-bottom: 12vh; }
.why .text p em { font-family: var(--serif); font-size: 1.12em; }
.why .text .wd { color: rgba(36,32,27,.2); transition: color .35s ease; }
.why .text .wd.lit { color: var(--ink); }
@media (prefers-reduced-motion: reduce) { .why .text .wd { color: var(--ink); transition: none; } }
@media (max-width: 960px) {
  .why .read { grid-template-columns: 1fr; gap: 30px; }
  .why .plate { top: 12px; z-index: 1; }
  .why .text p { margin-bottom: 40vh; }
}

/* 02 · two guided reads in one chapter, then the line it all comes to */
.why .conv { margin-top: 60px; }
.why .finale { margin: 40px auto 0; text-align: center; }
.why .finale .h { font-size: clamp(48px, 5.6vw, 96px); max-width: none; }
.why .finale .under svg { bottom: -.12em; height: .3em; }
.why .finale .motto { margin: 34px 0 0; font: italic 400 22px var(--serif); color: var(--ink-3); letter-spacing: .01em; }

/* the origin story is long: shorter rests between its paragraphs, and its two hinges set as statements */
.why .read .text p { margin-bottom: 12vh; }
.why .read .text p.stmt { font: italic 500 clamp(30px, 2.6vw, 40px)/1.2 var(--serif); letter-spacing: -.01em; max-width: 22ch; margin: 4vh 0 16vh; }
.why .read .text p:last-child { margin-bottom: 12vh; }
.why .mono { max-width: 20ch; }

/* a statement can carry its label: the signature lines are named, quietly, above themselves */
.why .read .text p.stmt[data-label]::before { content: attr(data-label); display: block; margin-bottom: 16px; font: 500 11px/1 var(--mono); font-style: normal; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); }
/* the close: almost nothing on the sheet but the line */
.why .finale { margin: 26vh auto 20vh; }

/* the suminagashi field: a screen-sized canvas that holds still while the sheet scrolls under it, multiplied onto the paper */
.paper > .inkfield { position: absolute; inset: 0; z-index: -1; pointer-events: none; mix-blend-mode: multiply; }   /* the blend sits on the layer itself, so it reaches the paper beneath */
.paper > .inkfield canvas { position: sticky; top: 0; display: block; width: 100%; height: 100vh; }

/* ── the chapter rail: a quiet stack of dashes at the right edge, one per chapter, like the markers beside a long
   conversation. The one you're in is brighter; hover stretches a dash and a card says what that chapter is about;
   a click glides there. Over the night hero it turns bone. ── */
.rail { position: fixed; right: 18px; top: 50%; translate: 0 -50%; z-index: 40; display: flex; flex-direction: column; align-items: flex-end; gap: 0; color: #24201b; transition: color .4s; }
.rail.on-dark { color: #ede0ca; }
/* a soft wash behind the stack, like the nav's, so the dashes read over leaves and photographs as well as paper */
.rail::before { content: ""; position: absolute; inset: -10px -8px -10px 22px; z-index: -1; border-radius: 3px; background: rgba(246,239,226,.62);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); transition: background .4s, left .35s cubic-bezier(.22,1,.36,1); }
.rail.hot::before { left: -10px; }   /* widens to hold the stretched dashes */
.rail.on-dark::before { background: rgba(23,23,21,.5); }
.rail button { position: relative; display: block; width: 48px; height: 11px; padding: 0; border: 0; background: none; cursor: pointer; }
.rail button i { position: absolute; right: 0; top: 4.5px; height: 2px; width: var(--w, 16px); border-radius: 1px; background: currentColor; opacity: .5;
  transition: opacity .25s; }   /* its length is sprung (spring.js) */
.rail button.cur i { opacity: .95; }
.rail button:hover i, .rail button:focus-visible i { opacity: 1; }
.rail button:focus-visible i { width: 44px; }
.rail button .card { position: absolute; right: 56px; top: 50%; translate: 0 -50%; width: max-content; max-width: 280px; padding: 10px 14px 11px; text-align: left;
  background: rgba(246,239,226,.97); border-radius: 3px; box-shadow: 0 0 0 1px rgba(36,32,27,.1), 0 14px 30px -14px rgba(40,26,10,.4);
  opacity: 0; transform: translateX(8px); pointer-events: none; transition: opacity .2s, transform .35s cubic-bezier(.22,1,.36,1); }
.rail button .card b { display: block; font: 500 10px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: #817b70; }
.rail button .card strong { display: block; margin-top: 6px; font: 500 19px/1.1 var(--serif); color: #24201b; }
.rail button .card em { display: block; margin-top: 4px; font: italic 400 15px/1.35 var(--serif); color: #4a443b; }
.rail button:hover .card, .rail button:focus-visible .card { opacity: 1; transform: none; }
.rail button:focus-visible { outline: none; }
@media (max-width: 960px) { .rail { display: none; } }
@media (prefers-reduced-motion: reduce) { .rail button i, .rail button .card { transition: none; } }

/* ── 02 · five stages: pile, grid, turn, mosaic, flick. Type and image share the sheet; the text inks word by word and
   each cue word lights its picture. ── */
.why .stg { display: grid; grid-template-columns: minmax(0, 470px) minmax(0, 1fr); gap: 72px; margin-top: 120px; align-items: start; }
.why .stg-grid, .why .stg-flick { grid-template-columns: minmax(0, 1fr) minmax(0, 470px); }
.why .stg .text p { margin: 0 0 14vh; font: 400 clamp(21px, 1.6vw, 25px)/1.55 var(--sans); letter-spacing: -.005em; color: var(--ink); max-width: 30ch; text-wrap: pretty; }
.why .stg .text p:first-child { margin-top: 18vh; }
.why .stg .text p:last-child { margin-bottom: 26vh; }
.why .stg .text p.stmt { font: italic 500 clamp(32px, 2.8vw, 46px)/1.15 var(--serif); letter-spacing: -.01em; max-width: 18ch; }
.why .stg .text p.stmt[data-label]::before { content: attr(data-label); display: block; margin-bottom: 16px; font: 500 11px/1 var(--mono); font-style: normal; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); }
.why .vis { position: sticky; top: 10vh; height: 80vh; }
.why .vis figure { margin: 0; }
.why .vis img { display: block; width: 100%; height: 100%; object-fit: cover; }
.why .vis figcaption { position: absolute; left: 10px; bottom: 9px; font: 500 10px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: #fbf6ec; text-shadow: 0 1px 6px rgba(0,0,0,.35); }

/* 1 · the pile: each sheet drops onto the desk, a little askew, as its word is read */
.pile .it { position: absolute; width: 64%; aspect-ratio: 3 / 2; box-shadow: 0 22px 40px -22px rgba(30,20,10,.55), 0 0 0 1px rgba(30,20,10,.06);
  opacity: 0; transform: translate(var(--x), calc(var(--y) - 40px)) rotate(calc(var(--r) * 2.2)) scale(1.06);
  transition: opacity .5s var(--ease), transform .9s cubic-bezier(.2,.9,.25,1.05), filter .6s; }
.pile .it.got { opacity: 1; transform: translate(var(--x), var(--y)) rotate(var(--r)); }
.pile .it.got:not(.now) { filter: saturate(.75) brightness(.97); }
.pile .it:nth-child(1) { --x: 18%; --y: 4%; --r: -4deg; aspect-ratio: 4 / 5; width: 46%; }
.pile .it:nth-child(2) { --x: 2%; --y: 20%; --r: 3deg; }
.pile .it:nth-child(3) { --x: 34%; --y: 12%; --r: -2deg; }
.pile .it:nth-child(4) { --x: 8%; --y: 42%; --r: 5deg; }
.pile .it:nth-child(5) { --x: 30%; --y: 50%; --r: -5deg; }
.pile .it:nth-child(6) { --x: 14%; --y: 30%; --r: 1.5deg; }

/* 2 · the grid: six posters, quiet until their word, then each one comes forward */
.bento { display: grid; grid-template-columns: repeat(3, 1fr); grid-template-rows: repeat(2, 1fr); gap: 14px; }
.bento .it { position: relative; overflow: hidden; border-radius: 3px; opacity: .28; filter: grayscale(.7) blur(1.5px); transform: scale(.97);
  transition: opacity .7s var(--ease), filter .8s var(--ease), transform .8s var(--ease), box-shadow .6s; }
.bento .it:nth-child(1) { grid-column: span 2; } .bento .it:nth-child(6) { grid-column: span 2; }
.bento .it.got { opacity: 1; filter: none; transform: none; }
.bento .it.now { box-shadow: 0 0 0 1px var(--ink), 0 26px 50px -30px rgba(30,20,10,.6); }

/* 3 · the turn: ink drifts down and takes root, scrubbed by the scroll */
.why .stg-turn { position: relative; height: 320vh; margin: 60px -64px 0; }
.why .stg-turn .pin { position: sticky; top: 0; height: 100vh; overflow: hidden; display: grid; place-items: center; }
.why .stg-turn .frames { position: absolute; inset: 0; }
.why .stg-turn .frames img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; mix-blend-mode: multiply; transition: opacity .25s linear; }
.why .stg-turn .frames img[data-f="0"] { object-fit: contain; }
.why .stg-turn .turn-line { position: relative; margin: 0; align-self: start; margin-top: 12vh; text-align: center; font: 500 clamp(44px, 5vw, 84px)/1 var(--serif); letter-spacing: -.02em; color: var(--ink);
  opacity: 0; transform: translateY(16px); transition: opacity .8s var(--ease), transform .9s var(--ease); }
.why .stg-turn .turn-line em { font-style: italic; font-weight: 400; }
.why .stg-turn .turn-line .k2 { display: block; margin-bottom: 18px; font: 500 11px/1 var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--ink-3); }
.why .stg-turn.said .turn-line { opacity: 1; transform: none; }

/* 4 · the mosaic: quiet stills, each one brightening as its word is read */
.mosaic { display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(3, 1fr); gap: 12px; }
.mosaic .it { position: relative; overflow: hidden; border-radius: 3px; opacity: .3; filter: saturate(.4) blur(1px); transition: opacity .7s var(--ease), filter .8s var(--ease), transform .8s var(--ease); }
.mosaic .it:nth-child(1) { grid-column: span 2; grid-row: span 2; } .mosaic .it:nth-child(2) { grid-row: span 2; } .mosaic .it:nth-child(6) { grid-row: span 2; }
.mosaic .it:nth-child(5) { grid-column: span 2; }
.mosaic .it.got { opacity: 1; filter: none; } .mosaic .it.now { transform: scale(1.015); }

/* 5 · the flick: one stamp for each word, flicked through as the line is read */
.flick { display: grid; place-items: center; }
.flick .it { position: absolute; inset: 4% 6% 12%; opacity: 0; transform: translateY(18px) rotate(1.5deg) scale(.98); transition: opacity .18s ease, transform .3s cubic-bezier(.2,.9,.3,1); }
.flick .it img { object-fit: contain; filter: drop-shadow(0 30px 40px rgba(20,14,8,.35)); }
.flick .it.got { opacity: 0; transform: translateY(-14px) rotate(-2deg) scale(1.02); }
.flick .it.now { opacity: 1; transform: none; }
.flick .word { position: absolute; left: 6%; bottom: 0; margin: 0; display: flex; gap: 14px; align-items: baseline; }
.flick .word .n { font: 500 11px var(--mono); letter-spacing: .14em; color: var(--ink-3); }
.flick .word .w2 { font: italic 400 clamp(28px, 2.4vw, 38px)/1 var(--serif); color: var(--ink); }
.why .text.slow p { margin-bottom: 18vh; }

@media (max-width: 960px) {
  .why .stg, .why .stg-grid, .why .stg-flick { grid-template-columns: 1fr; gap: 20px; }
  .why .vis { top: 8px; height: 46vh; z-index: 1; }
  .why .stg-grid .vis, .why .stg-flick .vis { order: -1; } .why .stg-turn { margin: 40px -22px 0; }
}

.why .stg .text .wd { color: rgba(36,32,27,.2); transition: color .3s ease; } .why .stg .text .wd.lit { color: var(--ink); }
.flick .word { transition: opacity .4s; }

/* ── 02 · Why Karya, in five acts: clean, editorial, big. Pictures are shown whole (contain), one at a time or in an
   even row; nothing overlaps, nothing is cropped, nothing waits greyed out. ── */
.why { max-width: 1440px; }
.why .wk-open .h { font-size: clamp(56px, 6.4vw, 108px); max-width: 16ch; }
.wk-lede { margin-top: 64px; max-width: 46ch; }
.wk-lede p { margin: 0 0 18px; font: 400 clamp(21px, 1.6vw, 25px)/1.55 var(--sans); color: var(--ink-2); }
.why .act { margin-top: 22vh; }
.act-h { max-width: 1100px; padding-bottom: 28px; border-bottom: 1px solid var(--hair); }
.act-h span { display: block; margin-bottom: 22px; font: 500 11.5px/1 var(--mono); letter-spacing: .18em; text-transform: uppercase; color: var(--ink-3); }
.act-h h3 { margin: 0; font: 500 clamp(44px, 4.6vw, 78px)/1.02 var(--serif); letter-spacing: -.025em; color: var(--ink); text-wrap: balance; }
.act-h h3 em { font-style: italic; font-weight: 400; }
.wk { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 6vw; align-items: start; margin-top: 4vh; }
.wk.rev { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.wk-txt p { margin: 0 0 18vh; font: 400 clamp(22px, 1.75vw, 28px)/1.5 var(--sans); letter-spacing: -.008em; color: var(--ink); text-wrap: pretty; }
.wk-txt p:first-child { margin-top: 26vh; }
.wk-txt p:last-child { margin-bottom: 34vh; }
.wk-txt .wd { color: rgba(36,32,27,.26); transition: color .3s ease; } .wk-txt .wd.lit { color: var(--ink); }
.wk-txt [data-cue] .wd.lit { color: var(--ink); text-decoration: underline; text-decoration-color: rgba(179,38,30,.5); text-decoration-thickness: 1px; text-underline-offset: 5px; }
.wk-fig { position: sticky; top: 8vh; height: 84vh; margin: 0; display: flex; flex-direction: column; }
.wk-fig .fr { position: relative; flex: 1; }
.wk-fig .fr img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; object-position: center; opacity: 0; transition: opacity .9s var(--ease); }
.wk-fig .fr img.on { opacity: 1; }
.wk-fig figcaption { display: flex; gap: 16px; align-items: baseline; margin-top: 18px; padding-top: 12px; border-top: 1px solid var(--hair); }
.wk-fig figcaption .n { font: 500 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); flex: none; }
.wk-fig figcaption .t { font: italic 400 clamp(19px, 1.5vw, 24px)/1.2 var(--serif); color: var(--ink); }
.wk-fig.flick .fr img { transition: opacity .16s ease, transform .3s cubic-bezier(.2,.9,.3,1); transform: translateY(14px) scale(.985); }
.wk-fig.flick .fr img.on { transform: none; }
.wk-txt.slow p { margin-bottom: 22vh; }
.wk-stmt { max-width: 22ch; margin: 0 0 0 auto; padding-top: 6vh; font: italic 500 clamp(36px, 3.4vw, 58px)/1.12 var(--serif); letter-spacing: -.015em; color: var(--ink); }
.wk-stmt span { display: block; margin-bottom: 20px; font: 500 11px/1 var(--mono); font-style: normal; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); }
.wk-stmt em { font-weight: 400; }
.wk-stmt.center { margin: 16vh auto 0; text-align: center; max-width: 24ch; }
/* IV · an even row: four stills, whole, at one size; the one being read is named beneath */
.wk-row .wk-txt.wide { max-width: 44ch; }
.wk-row .wk-txt.wide p:first-child { margin-top: 8vh; } .wk-row .wk-txt.wide p { margin-bottom: 6vh; } .wk-row .wk-txt.wide p:last-child { margin-bottom: 8vh; }
.row4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; position: sticky; top: 14vh; }
.row4 figure { margin: 0; }
.row4 img { display: block; width: 100%; aspect-ratio: 4 / 5; object-fit: contain; }
.row4 figcaption { display: flex; gap: 12px; align-items: baseline; margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--hair); font: italic 400 19px/1.25 var(--serif); color: var(--ink-3); transition: color .5s, border-color .5s; }
.row4 figcaption b { font: 500 10.5px/1 var(--mono); font-style: normal; letter-spacing: .12em; color: var(--ink-3); }
.row4 figure.on figcaption { color: var(--ink); border-top-color: var(--ink); }
/* III · the turn, whole and centred */
.why .stg-turn { margin: 22vh 0 0; height: 300vh; }
.why .stg-turn .pin { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4vh; }
.why .stg-turn .frames { position: relative; inset: auto; width: min(1200px, 100%); aspect-ratio: 1448 / 1086; max-height: 70vh; }
.why .stg-turn .frames img { object-fit: contain; }
.why .stg-turn .turn-line { margin: 0; align-self: center; }
@media (max-width: 960px) {
  .wk, .wk.rev { grid-template-columns: 1fr; gap: 24px; }
  .wk-fig { top: 6px; height: 48vh; z-index: 1; background: transparent; } .wk.rev .wk-fig { order: -1; }
  .wk-txt p:first-child { margin-top: 6vh; } .wk-txt p { margin-bottom: 30vh; }
  .row4 { grid-template-columns: 1fr 1fr; position: relative; top: auto; }
}
.wk-fig.flick { display: flex; place-items: initial; }

/* the frame takes its pictures' shape, centred in the view, so the caption sits right under the picture */
.wk-fig { height: auto; top: 50vh; translate: 0 -50%; }
.wk-fig .fr { flex: none; width: 100%; aspect-ratio: var(--ar, 3 / 2); max-height: 72vh; margin: 0 auto; }
.wk-fig[style*="4 / 5"] .fr, .wk-fig[style*="1 / 1"] .fr { width: auto; height: min(72vh, 100%); max-width: 100%; }
.wk-fig[style*="4 / 5"], .wk-fig[style*="1 / 1"] { align-items: flex-start; }
.wk-fig[style*="4 / 5"] .fr { height: 72vh; } .wk-fig[style*="1 / 1"] .fr { height: 68vh; }
.wk-fig figcaption { margin-top: 14px; }
@media (max-width: 960px) { .wk-fig { top: 6px; translate: none; } .wk-fig .fr, .wk-fig[style*="4 / 5"] .fr, .wk-fig[style*="1 / 1"] .fr { height: auto; width: 100%; max-height: 44vh; } }
@media (max-width: 960px) {
  .wk .wk-fig { order: -1; background: #efe6d5; padding: 8px 0 10px; margin: 0 -22px; padding-left: 22px; padding-right: 22px; box-shadow: 0 14px 16px -12px rgba(239,230,213,1); }
  .why .kick { white-space: nowrap; font-size: 10.5px; letter-spacing: .12em; }
  .wk-txt p:first-child { margin-top: 4vh; }
}

/* the page's paper is one screen-sized sheet held still behind the scrolling sections (as in 04), rendered at full
   sharpness, so its grain is the same fine grain everywhere */
.paper > .pbg .pbg-sheet { position: sticky; top: 0; width: 100%; height: 100vh; }
/* no upward shift: the picture starts below its act's heading and pins from there, so it never rides over the heading */
.wk-fig { translate: none; top: 12vh; margin-top: 4vh; }

/* Act II: the engineering philosophy is the last line of the read */
.wk-txt p.stmt { font: italic 500 clamp(32px, 2.8vw, 46px)/1.15 var(--serif); letter-spacing: -.01em; max-width: 18ch; }
.wk-txt p.stmt[data-label]::before { content: attr(data-label); display: block; margin-bottom: 16px; font: 500 11px/1 var(--mono); font-style: normal; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); }
/* the opening: the lede beside the enterprise collage */
.wk-open-row { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 5fr); gap: 6vw; align-items: end; }
.wk-open-fig { margin: 0; }
.wk-open-fig img { display: block; width: 100%; max-height: 74vh; object-fit: contain; object-position: left bottom; }
.wk-open-fig figcaption { display: flex; gap: 16px; align-items: baseline; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--hair); font: italic 400 clamp(19px, 1.5vw, 24px)/1.2 var(--serif); color: var(--ink); }
.wk-open-fig figcaption b { font: 500 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
@media (max-width: 960px) { .wk-open-row { grid-template-columns: 1fr; } }

/* Act IV: the shore painting, full width, its paper multiplied into the page's */
.why .shore { margin: 6vh 0 10vh; }
.why .shore canvas { display: block; width: 100%; aspect-ratio: 1600 / 900; mix-blend-mode: multiply; filter: saturate(0) brightness(1.1) contrast(1.06); }   /* its paper lifted to white, so only the ink is printed onto the page */
.why .shore figcaption { display: flex; gap: 16px; align-items: baseline; margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--hair); font: italic 400 clamp(19px, 1.5vw, 24px)/1.2 var(--serif); color: var(--ink); }
.why .shore figcaption b { font: 500 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }

/* IV · the first still is the shore painting, painting itself, shown whole in the same frame as its neighbours */
.row4 .cv { aspect-ratio: 4 / 5; display: flex; align-items: center; }
.row4 .cv canvas { display: block; width: 100%; aspect-ratio: 1600 / 900; mix-blend-mode: multiply; filter: saturate(0) brightness(1.1) contrast(1.06); }
.row4 { grid-template-columns: 2.2fr 1fr 1fr 1fr; align-items: end; }
.row4 .cv { aspect-ratio: auto; display: block; }
@media (max-width: 960px) { .row4 { grid-template-columns: 1fr 1fr; } .row4 figure#shore { grid-column: span 2; } }

/* IV · back to four even portrait tiles; the two paintings fill theirs */
.row4 { grid-template-columns: repeat(4, 1fr); align-items: start; }
.row4 .cv { aspect-ratio: 4 / 5; position: relative; overflow: hidden; display: block; }
.row4 .cv canvas { position: absolute; top: 0; height: 100%; width: auto; aspect-ratio: auto; mix-blend-mode: multiply; filter: saturate(0) brightness(1.1) contrast(1.06); }
.row4 .paint:not(.wide-src) .cv canvas { left: 50%; translate: -50% 0; aspect-ratio: 900 / 1200; }
/* the shore is wide: its right half fills the tile, and the ink fades out softly where the left half is cut away */
.row4 .wide-src .cv canvas { right: 0; aspect-ratio: 1600 / 900; }
.row4 .wide-src .cv { -webkit-mask: linear-gradient(90deg, transparent, #000 32%); mask: linear-gradient(90deg, transparent, #000 32%); }
@media (max-width: 960px) { .row4 { grid-template-columns: 1fr 1fr; } .row4 figure#shore { grid-column: auto; } }

/* Fig. 00: the tower, painting itself; only its ink is printed onto the page */
.wk-open-fig canvas { display: block; height: min(74vh, 760px); width: auto; aspect-ratio: 800 / 1200; max-width: 100%; mix-blend-mode: multiply; filter: saturate(0) brightness(1.1) contrast(1.06); }

.row4 #notesInk { aspect-ratio: 880 / 1100; }
.row4 #stonesInk { aspect-ratio: 880 / 1100; }
.wk-open-fig figcaption span { max-width: 44ch; line-height: 1.3; }
/* Why Karya: pictures change by a plain dissolve, never moving; the caption keeps one line's height so nothing shifts */
.wk-fig .fr img, .wk-fig.flick .fr img { transform: none !important; transition: opacity .55s ease; }
.wk-fig.flick .fr img { transition-duration: .25s; }
.wk-fig figcaption { min-height: 2.6em; align-items: flex-start; }
.wk-fig .fr img.was { opacity: 1; z-index: 1; transition: none; }
.wk-fig .fr img.on { z-index: 2; }

.story-end { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; margin: 80px 0 0; }

/* night (the tokens turn in v5.css): the colours set by hand. Words not yet read wait as faint bone; the rail and its
   cards go dark; the ink pictures, painted on ivory, sit on the dark sheet as lit prints. */
.night .paper { --hair: rgba(237,224,202,.2); --ink-c: #ede0ca; --ink-on: #171512; }
.night .why .text .wd, .night .why .stg .text .wd, .night .wk-txt .wd { color: rgba(237,224,202,.22); }
.night .rail { color: #ede0ca; }
.night .rail::before { background: rgba(23,21,18,.55); }
.night .rail button .card { background: rgba(31,28,24,.97); box-shadow: 0 0 0 1px rgba(237,224,202,.12), 0 14px 30px -14px rgba(0,0,0,.6); }
.night .rail button .card b { color: var(--ink-3); } .night .rail button .card strong { color: var(--ink); } .night .rail button .card em { color: var(--ink-70); }
.night .pile .it { box-shadow: 0 22px 40px -22px rgba(0,0,0,.8), 0 0 0 1px rgba(237,224,202,.08); }
.night #turn .frames img, .night .wk-fig img { filter: brightness(.9) sepia(.08); }
@media (max-width: 960px) { .night .wk .wk-fig { background: var(--paper); box-shadow: 0 14px 16px -12px var(--paper); } }
@media (prefers-reduced-motion: reduce) { .night .why .text .wd, .night .why .stg .text .wd, .night .wk-txt .wd { color: var(--ink); } }
/* night: the ink paintings are dark ink multiplied into ivory, which would vanish into the dark sheet; at night they
   are painted in bone ink instead (bone-ink in the page's svg), their paper gone, as the footer is */
.night .wk-open-fig canvas, .night .row4 .cv canvas { mix-blend-mode: normal; filter: url(#bone-ink); }

/* the story's bar (in place of the site menu): the mark, the title, how far you are, and Close. Frosted glass, as
   the site's bar; dark at night by the tokens. */
.story-bar { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 24px; height: 64px; padding: 0 var(--gut); border-bottom: 1px solid rgba(195,179,153,.55);
  font: 500 11.5px/1 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); }
.story-bar::before { content: ""; position: absolute; inset: 0; z-index: -1; background: rgba(243,235,221,.58); -webkit-backdrop-filter: blur(18px) saturate(1.15); backdrop-filter: blur(18px) saturate(1.15); }
.night .story-bar { border-bottom-color: var(--night-line); } .night .story-bar::before { background: rgba(23,21,18,.55); }
.story-bar .brand { color: var(--ink); letter-spacing: .16em; }
.story-prog { flex: 1; height: 1px; background: var(--hair); position: relative; }
.story-prog::after { content: ""; position: absolute; inset: 0; background: var(--ink); transform: scaleX(var(--prog, 0)); transform-origin: 0 50%; }
.story-x { display: inline-flex; align-items: center; gap: 10px; font: 500 14px var(--sans); letter-spacing: 0; text-transform: none; color: var(--ink); text-decoration: none; }
.story-x b { font: 400 26px/1 var(--serif); transition: transform .4s var(--ease-out-quint); } .story-x:hover b { transform: rotate(90deg); }
.story-end { display: flex; justify-content: center; margin: 40px 0 0; }
@media (max-width: 960px) { .story-bar { gap: 14px; } .story-bar .sb-t { display: none; } }
@media (prefers-reduced-motion: reduce) { .story-x b { transition: none; } }
