/* 東京手帖 (techo.html): the Tokyo chapters of the Language Café as a traveller's notebook, on a
   kissaten wall. Same engine and book units as Carnet de Paris (a page is 540 × 740, scaled). */
:root {
  --wall: #ece4d3;
  --wall-lo: #cdbfa2;
  --paper: #f7f2e4;      /* MD-style cream paper */
  --paper-2: #ebe4d2;
  --ink: #22201d;
  --ink-2: #57514a;
  --pencil: #8a8378;
  --fountain: #24427e;   /* your lines: blue-black ink */
  --shu: #c8372d;        /* vermilion: the hanko, the 上手 seal */
  --leather: #a8703f;    /* camel leather cover */
  --matcha: #5f8a4a;
  --ai: #2f5d8a;
  --yamabuki: #c08a1c;
  --beni: #b0352b;
  --grid: rgba(70,110,150,.17);
  --kraft: #c6a57a;
  --W: 540px;
  --H: 740px;
  --jp: 'Zen Old Mincho', serif;
  --hand: 'Klee One', cursive;
  --go: 'Zen Kaku Gothic New', sans-serif;
  --en: 'EB Garamond', serif;
}
* { 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 .sudare { left: -4vw; top: 8vh; width: min(44vw, 620px); height: 78vh; opacity: .12; filter: blur(2.5px); transform: skewY(-6deg); transform-origin: 0 0; }
.wall .noren { left: 50%; top: -8px; width: min(70vw, 900px); margin-left: calc(min(70vw, 900px) / -2); opacity: .1; filter: blur(3px); transform-origin: 50% 0; }
.wall .chochin { right: 4vw; top: 10vh; height: 52vh; opacity: .1; filter: blur(3.5px); transform-origin: 50% 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: camel leather, an elastic cord, a charm */
.cover { inset: 0; background: var(--leather); overflow: hidden; border-radius: 0 8px 8px 0; }
.cover > * { position: absolute; }
.cv-leather { inset: 0;
  background:
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='l'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.045' numOctaves='4' seed='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .2 0 0 0 0 .1 0 0 0 0 .03 0 0 0 .55 -.18'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23l)'/%3E%3C/svg%3E"),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.7' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .15 0 0 0 0 .08 0 0 0 0 .02 0 0 0 .5 -.2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23p)'/%3E%3C/svg%3E"),
    radial-gradient(70% 55% at 34% 26%, rgba(255,214,160,.28), transparent 70%),
    radial-gradient(60% 50% at 82% 92%, rgba(40,15,0,.35), transparent 70%); }
.cv-edge { inset: 7px 7px 7px 0; border: 1.5px dashed rgba(60,30,8,.4); border-left: 0; border-radius: 0 6px 6px 0; }
.cv-cord { left: 50%; margin-left: 110px; top: -4px; bottom: -4px; width: 6px; border-radius: 3px; background: linear-gradient(90deg, #2a1d14, #5a4232 45%, #22170f); box-shadow: 2px 0 3px rgba(0,0,0,.4); }
.cv-title { left: 60px; right: 100px; top: 220px; margin: 0; text-align: center; font: 700 78px/1 var(--jp); letter-spacing: .12em;
  color: rgba(70,36,10,.55); text-shadow: 0 1.5px 0 rgba(255,220,180,.35), 0 -1px 0 rgba(30,12,0,.45); }   /* pressed into the leather */
.cv-sub { left: 60px; right: 100px; top: 326px; margin: 0; text-align: center; font: 500 14px var(--en); letter-spacing: .55em; text-transform: uppercase; color: rgba(70,36,10,.55); text-shadow: 0 1px 0 rgba(255,220,180,.3); }
.cv-foot { left: 60px; right: 100px; bottom: 64px; margin: 0; text-align: center; font: 400 15px var(--jp); letter-spacing: .3em; color: rgba(60,30,8,.45); }
.cv-charm { right: 74px; bottom: -6px; width: 48px; height: 120px; overflow: visible; }

/* ---------------------------------------------------------------- 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 { /* 5 mm grid, a darker line every five */
  background-image:
    repeating-linear-gradient(0deg, transparent 0 19px, var(--grid) 19px 20px),
    repeating-linear-gradient(90deg, transparent 0 19px, var(--grid) 19px 20px);
  background-position: 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 .sudare, body.single .wall .chochin { 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; }
