/* 北京手帐 (beijing.html): a Language Café conversation notebook, on the 東京手帖 engine and layout
   (a page is 540 × 740 book units, scaled). */
:root {
  --wall: #e7e4dc; --wall-lo: #c4beb2; --paper: #f8f5ec; --paper-2: #ebe6da; --ink: #1f1f22; --ink-2: #4f4f55; --pencil: #85827d; --fountain: #1f3f7f; --shu: #b8312a; --leather: #4e2f4f;   /* aubergine (was indigo, too close to ことば帖) */
  --kafei: #8a5a3c; --jiandan: #c99520; --ditie: #3a6ea5; --mala: #a52a24; --grid: rgba(70,140,110,.3); --kraft: #c9ad85;
  --jp: 'Noto Serif SC', serif; --hand: 'Ma Shan Zheng', cursive; --go: 'Noto Serif SC', serif; --en: 'EB Garamond', serif;
  --W: 540px;
  --H: 740px;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
button { -webkit-tap-highlight-color: transparent; touch-action: manipulation; font: inherit; }
body {
  color: var(--ink); font-family: var(--jp); overflow: hidden; -webkit-font-smoothing: antialiased;
  /* warm plaster in late-afternoon light, coming in low from the left */
  background-color: var(--wall);
  background-image:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='600'%3E%3Cfilter id='m'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.007' numOctaves='4' seed='8'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .43 0 0 0 0 .32 0 0 0 .34 -.1'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23m)'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .38 0 0 0 0 .33 0 0 0 0 .26 0 0 0 .28 -.1'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E"),
    radial-gradient(55% 70% at 18% 46%, rgba(255,226,180,.8), transparent 70%),
    radial-gradient(130% 100% at 50% 50%, transparent 55%, var(--wall-lo) 100%);
  background-size: 100% 100%, 180px 180px, auto, auto;
  background-repeat: no-repeat, repeat, no-repeat, no-repeat;
  background-attachment: fixed;
}
#defs { position: absolute; width: 0; height: 0; overflow: hidden; }

/* the wall's shadows */
.wall { position: fixed; inset: 0; pointer-events: none; z-index: 1; overflow: hidden; }
.wall svg { position: absolute; }
.wall .lattice { left: -3vw; top: 8vh; width: min(42vw, 580px); opacity: .11; filter: blur(3px); transform: skewY(-6deg); transform-origin: 0 0; }
.wall .cage { right: 7vw; top: -10px; height: 56vh; opacity: .11; filter: blur(3px); transform-origin: 50% 0; }
.wall .kaki { right: 18vw; top: -20px; width: min(40vw, 520px); opacity: .1; filter: blur(3.5px); transform-origin: 100% 0; }

/* ---------------------------------------------------------------- the book (the Palabrario engine) */
.frame { position: fixed; left: 50%; top: 50%; width: calc(var(--W) * 2); height: var(--H); z-index: 10; }
.frame.single { width: var(--W); clip-path: inset(-40px 0 -220px 0); touch-action: none; }
.book { position: absolute; left: 0; top: 0; width: calc(var(--W) * 2); height: var(--H); perspective: 3800px; }
.block { position: absolute; top: 0; height: 100%; width: var(--W); border-radius: 3px; background: var(--paper-2); }
.block.l { left: 0; } .block.r { left: var(--W); }
.page, .face { position: absolute; top: 0; width: var(--W); height: var(--H); overflow: hidden; background: var(--paper); }
.slot-l { left: 0; } .slot-r { left: var(--W); }
.page::before, .face::before { /* a fine grain in the paper */
  content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 0; opacity: .4;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .3 0 0 0 0 .27 0 0 0 0 .22 0 0 0 .4 -.18'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23g)'/%3E%3C/svg%3E");
}
.pg-l::after, .pg-r::after { content: ''; position: absolute; inset: 0; pointer-events: none; z-index: 20; }
.pg-l::after { background: linear-gradient(270deg, rgba(50,35,20,.14), transparent 7%); }
.pg-r::after { background: linear-gradient(90deg, rgba(50,35,20,.14), transparent 7%); }
.page > *, .face > * { position: absolute; z-index: 1; }
.gutter { position: absolute; left: calc(var(--W) - 1px); width: 2px; top: 0; height: 100%; pointer-events: none; z-index: 60; background: rgba(50,35,20,.16); }
.frame.closed .gutter, .frame.closed .tabs { display: none; }
.leaf { position: absolute; left: var(--W); top: 0; width: var(--W); height: var(--H); transform-origin: 0% 50%; transform-style: preserve-3d; z-index: 100; }
.leaf .face { left: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.leaf .face.back { transform: rotateY(180deg); }
.leaf .shade { position: absolute; inset: 0; z-index: 30; pointer-events: none; opacity: 0; }
.leaf .front .shade { background: linear-gradient(90deg, rgba(40,25,10,.5), rgba(40,25,10,.12) 40%, transparent); }
.leaf .back .shade { background: linear-gradient(270deg, rgba(40,25,10,.4), rgba(40,25,10,.1) 40%, transparent); }

/* ---------------------------------------------------------------- the cover */
.cover { inset: 0; background: var(--leather); overflow: hidden; border-radius: 0 8px 8px 0; }
.cover > * { position: absolute; }
.cv-cloth { inset: 0;
  background:
    repeating-linear-gradient(0deg, rgba(255,255,255,.05) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(0,0,0,.12) 0 1px, transparent 1px 3px),
    radial-gradient(70% 55% at 34% 26%, rgba(150,180,230,.22), transparent 70%),
    radial-gradient(60% 50% at 82% 92%, rgba(0,0,10,.35), transparent 70%); }
.cv-slip { left: 70px; top: 70px; width: 76px; height: 330px; background: #f5efe0; box-shadow: 0 1px 2px rgba(0,0,0,.35); display: grid; place-items: center; outline: 1.5px solid rgba(160,40,30,.5); outline-offset: -7px; }
.cv-slip .cv-title { position: static; margin: 0; writing-mode: vertical-rl; font: 400 54px/1 'Ma Shan Zheng', serif; letter-spacing: .1em; color: #1f1f22; }
.cv-sub { left: 170px; top: 76px; margin: 0; writing-mode: vertical-rl; font: italic 16px var(--en); letter-spacing: .3em; color: rgba(220,225,240,.55); }
.cv-seal { right: 92px; bottom: 120px; width: 66px; height: 66px; display: grid; place-items: center; background: #b8312a; color: #f6e7dc; font: 400 44px 'Ma Shan Zheng', serif; border-radius: 4px; box-shadow: inset 0 0 0 4px #b8312a, inset 0 0 0 6px rgba(246,231,220,.7); filter: url(#stamp); }
.cv-foot { left: 60px; right: 100px; bottom: 56px; margin: 0; text-align: center; font: 500 14px var(--jp); letter-spacing: .4em; color: rgba(220,225,240,.4); }
.cv-cord { right: 0; top: 300px; width: 70px; height: 10px; background: #b8312a; border-radius: 5px 0 0 5px; box-shadow: 0 2px 3px rgba(0,0,0,.4); }
.cv-cord i { position: absolute; left: -18px; top: -9px; width: 26px; height: 26px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #8fcfb0, #3f8f6e 60%, #2a6650); box-shadow: 0 2px 3px rgba(0,0,0,.4); }

/* ---------------------------------------------------------------- endpapers: kraft, a ticket, an IC card, a receipt */
.endp .kraft { inset: 0; background-color: var(--kraft);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='300' height='300'%3E%3Cfilter id='k'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.03 .4' numOctaves='3' seed='9' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .35 0 0 0 0 .25 0 0 0 0 .12 0 0 0 .35 -.05'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23k)'/%3E%3C/svg%3E"); }
.kippu { width: 200px; height: 88px; padding: 10px 14px; border-radius: 3px; box-shadow: 0 2px 4px rgba(60,40,10,.3); display: flex; flex-direction: column; color: #24324a;
  background: repeating-linear-gradient(45deg, rgba(120,160,200,.18) 0 2px, transparent 2px 5px), #f3efe2; }
.kippu b { font: 700 22px var(--jp); letter-spacing: .1em; }
.kippu span { font: 500 13px var(--go); }
.kippu i { position: absolute; right: 12px; bottom: 9px; font: 400 11px ui-monospace, Menlo, monospace; font-style: normal; color: #6b5a3a; }
.iccard { width: 180px; height: 114px; border-radius: 10px; padding: 14px 16px; box-shadow: 0 3px 6px rgba(40,30,10,.35); color: #fff; display: flex; flex-direction: column; justify-content: space-between;
  background: linear-gradient(135deg, #3f8f6b 0 42%, #e9e4d6 42% 100%); }
.iccard b { font: 700 18px var(--go); letter-spacing: .12em; }
.iccard span { align-self: flex-end; font: 500 12px var(--go); color: #3a5a4a; letter-spacing: .1em; }
.receipt { width: 196px; padding: 16px 16px 26px; background: #fbfaf6; box-shadow: 0 2px 5px rgba(60,40,10,.28); display: flex; flex-direction: column; gap: 3px; font: 400 12px var(--go); color: #444;
  -webkit-mask: linear-gradient(#000 0 0) top/100% calc(100% - 8px) no-repeat, conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom/12px 8px repeat-x;
          mask: linear-gradient(#000 0 0) top/100% calc(100% - 8px) no-repeat, conic-gradient(from -45deg at bottom, #0000, #000 1deg 89deg, #0000 90deg) bottom/12px 8px repeat-x; }
.receipt b { font: 700 16px var(--jp); text-align: center; margin-bottom: 6px; letter-spacing: .3em; color: #222; }
.receipt .tot { border-top: 1px dashed #aaa; padding-top: 4px; margin-top: 2px; }
.receipt i { text-align: center; font: 600 16px var(--hand); font-style: normal; margin-top: 6px; color: var(--fountain); }

/* ---------------------------------------------------------------- title, contents, how-to */
.tp-kicker { left: 0; right: 0; top: 104px; margin: 0; text-align: center; font: 500 13px var(--en); letter-spacing: .45em; text-transform: uppercase; color: var(--pencil); }
.tp-title { left: 0; right: 0; top: 148px; margin: 0; text-align: center; font: 700 96px/1 var(--jp); letter-spacing: .14em; padding-left: .14em; }
.tp-title em { font-style: normal; color: var(--shu); }
.tp-sub { left: 0; right: 0; top: 278px; margin: 0; text-align: center; font: 400 19px var(--jp); letter-spacing: .2em; color: var(--ink-2); }
.tp-sub-en { left: 0; right: 0; top: 312px; margin: 0; text-align: center; font: italic 17px var(--en); color: var(--pencil); }
.tp-cast { left: 50px; right: 50px; top: 392px; display: flex; justify-content: center; gap: 4px; }
.tp-cast .pt { width: 106px; height: 106px; }
.tp-en { left: 0; right: 0; bottom: 78px; margin: 0; text-align: center; font: 400 16px/1.5 var(--en); color: var(--pencil); }
.pg-h { left: 70px; top: 62px; margin: 0; font: 700 40px var(--jp); letter-spacing: .2em; }
.pg-h small { font: italic 18px var(--en); letter-spacing: 0; color: var(--pencil); margin-left: 14px; }
.toc { left: 64px; right: 56px; top: 150px; margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.toc li { position: relative; display: grid; grid-template-columns: 70px 1fr; padding: 14px 8px 14px 0; border-top: 1px solid rgba(35,32,28,.14); cursor: pointer; transition: background .2s; }
.toc li:hover { background: rgba(200,55,45,.04); }
.toc .n { grid-row: span 2; font: 600 22px/1.3 var(--jp); color: var(--c); }
.toc .t { font: 600 25px/1.15 var(--jp); display: flex; align-items: baseline; gap: 12px; }
.toc .t i { font: italic 16px var(--en); color: var(--ink-2); }
.toc .m { font: 400 15px/1.35 var(--en); color: var(--pencil); margin-top: 3px; }
.toc .tick { position: absolute; right: 6px; top: 12px; width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; font: 700 15px var(--jp); color: var(--shu); border: 2px solid var(--shu); transform: rotate(-10deg); opacity: .85; filter: url(#stamp); }
.pg-foot { left: 64px; bottom: 56px; margin: 0; font: italic 15px var(--en); color: var(--pencil); }
.how { left: 70px; right: 64px; top: 150px; margin: 0; padding: 0 0 0 22px; display: flex; flex-direction: column; gap: 18px; font: 400 18px/1.45 var(--en); color: var(--ink-2); }
.how b { color: var(--ink); font: 600 18px var(--jp); margin-right: 4px; }
.how em { color: var(--shu); font-style: normal; font-family: var(--jp); }
.how-keys { left: 70px; right: 64px; bottom: 60px; margin: 0; font: italic 14px var(--en); color: var(--pencil); }
.how-keys b { font-style: normal; color: var(--shu); font-weight: 500; }

/* ---------------------------------------------------------------- a chapter: the card (left) */
.ch-n { left: 64px; top: 56px; margin: 0; font: 600 14px var(--jp); letter-spacing: .3em; color: var(--c); }
.ch-n span { font: 500 12px var(--en); letter-spacing: .3em; text-transform: uppercase; margin-left: 10px; color: var(--pencil); }
.ch-title { left: 62px; top: 80px; margin: 0; font: 700 50px/1 var(--jp); letter-spacing: .08em; }
.ch-title small { font: italic 22px var(--en); letter-spacing: 0; color: var(--ink-2); margin-left: 14px; }
.ch-place { left: 64px; top: 140px; margin: 0; font: 400 15px var(--jp); color: var(--pencil); }
.ch-who { left: 54px; right: 50px; top: 166px; display: flex; gap: 6px; }
.ch-who figure { margin: 0; display: flex; align-items: center; gap: 10px; }
.ch-who .pt { width: 104px; height: 104px; }
.ch-who.duo .pt { width: 96px; height: 96px; }
.ch-who figcaption { display: flex; flex-direction: column; font: 400 14px var(--jp); color: var(--ink-2); white-space: nowrap; }
.ch-who figcaption b { font: 500 24px var(--en); color: var(--ink); }
.lbl { display: block; font: 600 12px var(--jp); letter-spacing: .3em; color: var(--pencil); margin-bottom: 6px; }
.lbl span { font: 500 11px var(--en); letter-spacing: .3em; text-transform: uppercase; margin-left: 8px; }
.mission { left: 64px; right: 64px; top: 290px; padding: 14px 18px 12px; background: #fffdf6; box-shadow: 0 1px 3px rgba(60,40,10,.18); transform: rotate(-0.8deg); }
.mission::before { /* washi tape */
  content: ''; position: absolute; left: 50%; top: -10px; width: 86px; height: 20px; margin-left: -43px; transform: rotate(2deg); opacity: .8; box-shadow: 0 1px 1px rgba(0,0,0,.06);
  background: repeating-linear-gradient(-45deg, var(--c) 0 5px, rgba(255,255,255,.55) 5px 10px); }
.mission .jp { margin: 0; font: 600 18px/1.4 var(--jp); }
.mission .ro { margin: 3px 0 0; font: italic 14px var(--en); color: var(--ink-2); }
.mission .en { margin: 1px 0 0; font: italic 14px var(--en); color: var(--pencil); }
.mots { left: 58px; right: 52px; top: 420px; display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.mots .lbl { grid-column: 1 / -1; margin-left: 6px; }
.mot { appearance: none; background: none; border: 0; border-radius: 4px; padding: 3px 6px; text-align: left; cursor: pointer; display: grid; grid-template-columns: 1fr; gap: 0; min-width: 0; transition: background .2s; }
.mot:hover, .mot.playing, .mot.flash { background: rgba(200,55,45,.07); }
.mot .w { font: 600 16px/1.25 var(--jp); color: var(--ink); white-space: nowrap; }
.mot .g { font: italic 12.5px var(--en); color: var(--pencil); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mot .parts { display: flex; gap: 1px; margin: 1px 0 0 -2px; }
.mot .parts i { font: 400 10.5px/1.3 var(--jp); font-style: normal; color: var(--pencil); padding: 0 2px; border-radius: 2px; transition: background .15s, color .15s; }
.mot .parts i.on { background: var(--c, var(--shu)); color: #fff; }
/* the chapter's commemorative stamp (like a station's eki stamp), pressed once the mission is done */
.kinen { right: 40px; top: 52px; width: 140px; height: 140px; color: var(--c); transform: rotate(-12deg); opacity: .85; filter: url(#stamp); }
.kinen svg { width: 100%; height: 100%; overflow: visible; }

/* ---------------------------------------------------------------- a chapter: the conversation (right) */
.talk-page { /* 方格: 40-unit squares with dashed 田字 cross lines, like a Chinese exercise book */
  background-image:
    repeating-linear-gradient(0deg, transparent 0 39px, var(--grid) 39px 40px),
    repeating-linear-gradient(90deg, transparent 0 39px, var(--grid) 39px 40px),
    repeating-linear-gradient(0deg, transparent 0 19px, rgba(70,140,110,.12) 19px 20px),
    repeating-linear-gradient(90deg, transparent 0 19px, rgba(70,140,110,.12) 19px 20px);
  background-position: 0 6px, 6px 0, 0 6px, 6px 0; }
.talk-h { left: 92px; right: 40px; top: 34px; display: flex; justify-content: space-between; align-items: center; font: 600 13px var(--jp); letter-spacing: .3em; color: var(--pencil); background: var(--paper); padding: 2px 0; }
.en-btn { appearance: none; background: var(--paper); border: 1px solid rgba(35,32,28,.2); border-radius: 999px; padding: 2px 9px; cursor: pointer; font: 600 11px var(--en); letter-spacing: .2em; color: var(--pencil); }
.show-en .en-btn { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.talk { left: 6px; right: 36px; top: 72px; bottom: 150px; display: flex; flex-direction: column; justify-content: flex-end; gap: 14px; overflow: hidden;
  -webkit-mask-image: linear-gradient(transparent, #000 70px); mask-image: linear-gradient(transparent, #000 70px); }
.line { position: relative; flex: 0 0 auto; }
.line.them, .line.note { padding-left: 86px; }   /* the text starts past the margin; how it is said sits in the margin */
.line p { margin: 0; }
.line .who { display: block; font: 500 12px var(--en); letter-spacing: .25em; text-transform: uppercase; color: var(--pencil); }
.line .mood { position: absolute; left: 0; top: 14px; width: 72px; text-align: right; font: 400 12.5px/1.15 var(--hand); color: var(--pencil); transform: rotate(-3deg); }
.line.them .txt { font: 600 22px/1.4 var(--jp); color: var(--ink-2); transition: color .3s; }
.line.them.on .txt, .line.them:last-of-type .txt { color: var(--ink); }
.line.them.on::before { content: ''; position: absolute; left: 76px; top: 18px; bottom: 2px; width: 2px; background: var(--shu); border-radius: 2px; }
.line.help .txt { font-family: var(--en); font-style: italic; font-weight: 500; font-size: 21px; }
.line .ro { font: italic 15px var(--en); color: var(--ink-2); margin-top: 1px; }
.line .en { display: none; font: italic 15px var(--en); color: var(--pencil); margin-top: 1px; }
.show-en .line .en { display: block; }
.voc { border-bottom: 2px dotted var(--shu); cursor: pointer; }
.voc:hover { color: var(--shu); }
.line.you { align-self: flex-end; max-width: 86%; text-align: right; padding-right: 10px; }
.line.you .txt { font: 600 23px/1.3 var(--hand); color: var(--fountain); }
.line.you.miss .txt { opacity: .6; }
/* 上手: a little round vermilion seal on a line that passed */
.okstamp { position: absolute; left: -48px; top: -6px; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font: 700 14px/1 var(--jp); letter-spacing: 0; color: var(--shu); border: 2px solid var(--shu); filter: url(#stamp); writing-mode: vertical-rl; }
.line.note .txt { font: 400 17px/1.35 var(--hand); color: var(--pencil); padding-left: 2px; }
.line.note b { font-weight: 600; color: var(--ink-2); }
.line.note .en-n { font: italic 14px var(--en); }

.ctrl { left: 70px; right: 24px; bottom: 34px; height: 100px; display: flex; align-items: center; justify-content: center; gap: 15px; }
.act { appearance: none; background: var(--paper); border: 0; padding: 4px 2px; cursor: pointer; font: 500 15px var(--jp); color: var(--ink-2); border-bottom: 1px solid rgba(35,32,28,.3); transition: color .2s, border-color .2s; display: flex; flex-direction: column; align-items: center; line-height: 1.15; }
.act small { font: italic 11.5px var(--en); color: var(--pencil); }
.act:hover { color: var(--shu); border-color: var(--shu); }
/* the mic is a hanko: a round vermilion seal, its face carved 話す */
.seal { appearance: none; border: 0; padding: 0; cursor: pointer; width: 84px; height: 84px; flex: 0 0 84px; border-radius: 50%; position: relative; display: grid; place-items: center;
  background: radial-gradient(circle at 36% 30%, #e0574a, #c8372d 52%, #8e2019); box-shadow: 0 3px 6px rgba(80,15,8,.35), inset 0 -3px 6px rgba(0,0,0,.22), inset 0 2px 3px rgba(255,200,180,.3); transition: transform .15s; }
.seal::before { content: ''; position: absolute; inset: 8px; border-radius: 50%; border: 2px solid rgba(255,236,226,.55); }
.seal span { font: 700 19px var(--jp); letter-spacing: .06em; color: #fff3ec; text-shadow: 0 -1px 0 rgba(0,0,0,.25); }
.seal:hover { transform: scale(1.04); }
.seal.rec { animation: breathe 1.1s ease-in-out infinite; }
.seal.thinking span { animation: fade 1s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.08); box-shadow: 0 0 0 10px rgba(200,55,45,.13), 0 3px 6px rgba(80,15,8,.35); } }
@keyframes fade { 50% { opacity: .35; } }
.write { position: absolute; left: 0; right: 0; bottom: 104px; }
.write input { width: 100%; border: 0; border-bottom: 1.5px solid var(--fountain); background: var(--paper); padding: 4px 4px; font: 600 22px var(--hand); color: var(--fountain); outline: none; }

/* ---------------------------------------------------------------- the end */
.fin-h { left: 0; right: 0; top: 220px; margin: 0; text-align: center; font: 700 92px var(--jp); letter-spacing: .2em; padding-left: .2em; }
.fin-sub { left: 0; right: 0; top: 352px; margin: 0; text-align: center; font: 400 21px var(--jp); color: var(--ink-2); }
.fin-en { left: 0; right: 0; top: 394px; margin: 0; text-align: center; font: italic 16px var(--en); color: var(--pencil); }
.colo { left: 0; right: 0; bottom: 60px; margin: 0; text-align: center; font: italic 13px var(--en); color: var(--pencil); }

.pt { overflow: visible; }

/* ---------------------------------------------------------------- tabs, ribbon, controls */
.tabs { position: absolute; left: calc(var(--W) * 2); top: 86px; display: flex; flex-direction: column; gap: 10px; z-index: -1; }
.tab { appearance: none; width: 40px; height: 92px; border: 0; border-radius: 0 4px 4px 0; padding: 0 0 0 9px; margin-left: -4px; cursor: pointer; color: #fff8ec; font: 600 15px/1 var(--jp); letter-spacing: .2em; writing-mode: vertical-rl; display: grid; place-items: center; box-shadow: inset 6px 0 8px rgba(0,0,0,.16); transition: transform .2s; opacity: .9; }
.tab:hover, .tab.on { transform: translateX(6px); opacity: 1; }
.tab.light { color: var(--ink); background: #efe8d6; }
.frame.single .tabs { display: none; }
.ribbon { position: absolute; left: 0; top: 0; overflow: visible; z-index: 70; pointer-events: none; filter: drop-shadow(1px 2px 1.5px rgba(60,20,10,.35)); }
.ribbon .band { pointer-events: visibleStroke; cursor: pointer; }
.ribbon .hit { pointer-events: all; cursor: pointer; }
.nav { position: fixed; top: 50%; z-index: 20; appearance: none; background: none; border: 1px solid rgba(35,32,28,.25); border-radius: 999px; color: rgba(35,32,28,.75); cursor: pointer; display: flex; align-items: center; gap: 8px; transform: translateY(-50%); transition: color .2s, border-color .2s; padding: 9px 16px; font: 500 16px var(--en); letter-spacing: .06em; }
.nav:hover { color: var(--ink); border-color: rgba(35,32,28,.6); }
.nav .a { font-size: 22px; line-height: 1; }
.nav.back { left: 18px; } .nav.fwd { right: 18px; }
.nav[disabled] { opacity: .25; cursor: default; }
.markbtn { position: fixed; right: 18px; bottom: 18px; z-index: 20; appearance: none; background: none; border: 1px solid rgba(35,32,28,.25); border-radius: 999px; color: rgba(35,32,28,.75); cursor: pointer; padding: 7px 14px; font: 500 15px var(--en); display: flex; gap: 8px; align-items: baseline; }
.markbtn b { color: var(--shu); font: 600 15px var(--jp); }
.markbtn.on { border-color: var(--shu); }
.markbtn[hidden], .tocbtn { display: none; }
.hint { position: fixed; left: 0; right: 0; bottom: 36px; margin: 0; text-align: center; z-index: 20; font: italic 15px var(--en); color: rgba(35,32,28,.55); letter-spacing: .04em; }
.hint span { font: 400 14px var(--jp); font-style: normal; }
.credit { position: fixed; left: 0; right: 0; bottom: 12px; margin: 0; text-align: center; z-index: 20; font: italic 13px var(--en); color: rgba(35,32,28,.55); letter-spacing: .04em; pointer-events: none; }
.credit a { color: var(--shu); text-decoration: none; border-bottom: 1px solid rgba(200,55,45,.35); pointer-events: auto; }
.back-link { position: fixed; top: 14px; left: 18px; z-index: 30; padding: 5px 13px 6px; border: 1px solid rgba(35,32,28,.22); border-radius: 999px; color: rgba(35,32,28,.7); text-decoration: none; font: 500 15px var(--en); letter-spacing: .05em; }
.back-link:hover { color: var(--ink); border-color: rgba(35,32,28,.55); }

/* ---------------------------------------------------------------- one page at a time (phones) */
body.single .wall .lattice, body.single .wall .cage { opacity: .07; }
body.single .credit { bottom: auto; top: calc(10px + env(safe-area-inset-top)); left: 90px; right: 12px; text-align: right; font-size: 12px; }
body.single .hint { bottom: calc(76px + env(safe-area-inset-bottom)); font-size: 14px; }
body.single .back-link { top: calc(6px + env(safe-area-inset-top)); left: 10px; padding: 3px 10px 4px; font-size: 13px; background: rgba(255,255,255,.35); }
body.single .nav, body.single .tocbtn:not([hidden]), body.single .markbtn {
  top: auto; bottom: calc(14px + env(safe-area-inset-bottom)); transform: none; height: 44px; padding: 0 16px;
  background: rgba(247,242,228,.6); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
body.single .nav.back { left: 12px; } body.single .nav.fwd { right: 12px; }
body.single .tocbtn:not([hidden]) { display: grid; place-items: center; position: fixed; z-index: 20; left: 50%; margin-left: -80px; width: 74px; appearance: none; border: 1px solid rgba(35,32,28,.22); border-radius: 999px; color: rgba(35,32,28,.75); font: 600 15px var(--jp); letter-spacing: .1em; padding: 0; cursor: pointer; }
body.single .markbtn { left: 50%; right: auto; margin-left: 6px; width: 54px; justify-content: center; align-items: center; padding: 0; }
body.single .markbtn .t { display: none; }
.frame.tall .talk-page .talk { bottom: 170px; }
.frame.tall .talk-page .ctrl { bottom: 50px; }
.frame.tall .card .mots { top: 452px; }

/* a page whose ink hasn't settled yet (inkIn() reveals it) */
.pre .toc li, .pre .mot, .pre .how li { opacity: 0; }

/* ---------------------------------------------------------------- beijing: type and details */
.kinen { right: 22px; top: 256px; width: 124px; height: 124px; }   /* pressed onto the mission slip, clear of the title */
.okstamp { width: 46px; height: 46px; left: -52px; font: 700 15px/1 var(--jp); }
.kippu { width: 236px; }
.kippu b { font-size: 19px; }
.line .mood { font: 400 15px/1.05 'Caveat', cursive; }
.line.them .txt { font: 500 21px/1.45 var(--jp); }
.line.you .txt { font: 400 28px/1.2 var(--hand); }
.line.note .txt { font: 400 20px/1.3 var(--hand); }
.write input { font: 400 26px var(--hand); }
.tp-title { font: 400 104px/1 'Ma Shan Zheng', serif; letter-spacing: .06em; }
.ch-title { font: 700 48px/1 var(--jp); }
.fin-h { font: 400 120px 'Ma Shan Zheng', serif; }
.mot .w { font: 700 16px/1.25 var(--jp); }
.seal span { font: 700 21px var(--jp); }
.tab { font: 700 14px/1 var(--jp); }
