@font-face {
  font-family: Lora;
  src: url("/assets/fonts/lora-Lora[wght].woff2");
}
@font-face {
  font-family: Source;
  src: url("/assets/fonts/sourcesans3-SourceSans3[wght].woff2");
}
@font-face {
  font-family: Caveat;
  src: url("/assets/fonts/caveat-Caveat[wght].woff2");
}
:root {
  color: #302e27;
  background: #e8e3d9;
  font-family: Source, sans-serif;
  font-size: 16px;
  --paper: url("/assets/hotori/quiet-bank-paper-v2.webp");
  --ease: cubic-bezier(0.22, 0.75, 0.25, 1);
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  min-width: 280px;
}
button,
a,
input,
textarea,
select {
  -webkit-tap-highlight-color: transparent;
}
button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}
button:disabled {
  cursor: default;
  opacity: 0.5;
}
button:focus-visible,
a:focus-visible,
input:focus-visible,
textarea:focus-visible,
summary:focus-visible,
#feedback:focus-visible {
  outline: 2px solid #42523d;
  outline-offset: 5px;
}
button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.3;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}
button {
  touch-action: manipulation;
}
[hidden] {
  display: none !important;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.skip {
  position: fixed;
  top: -100px;
  left: 20px;
  z-index: 20;
  padding: 14px;
  background: #f2ece0;
  color: #302e27;
}
.skip:focus {
  top: 10px;
}
.scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 54%;
  z-index: -2;
}
.scene-failed {
  background: radial-gradient(ellipse at 50% 68%, #9eaa96, #dcd6c9 65%);
}
.header {
  position: absolute;
  inset: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 32px 5vw;
  z-index: 1;
  background: linear-gradient(#eee9dfaa, transparent);
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font:
    36px Lora,
    serif;
  color: inherit;
  text-decoration: none;
}
.brand img {
  width: 34px;
  height: 42px;
  object-fit: contain;
}
.quiet,
.icon {
  border: 0;
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 44px;
  padding: 10px 12px;
  font-size: 15px;
  line-height: 1.35;
}
.quiet:hover,
.icon:hover {
  color: #536549;
}
.icon {
  width: 44px;
}
.header .quiet {
  background: transparent;
  border-radius: 2px;
}
.intro {
  position: absolute;
  top: 130px;
  left: 5.5vw;
  max-width: 320px;
}
.intro h1 {
  font:
    400 clamp(19px, 2.1vw, 27px)/1.45 Lora,
    serif;
  margin: 0 0 14px;
}
.intro p {
  font-size: 15px;
  margin: 0;
}
.bank {
  position: relative;
  min-height: 690px;
  height: 100svh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 300px;
}
.stack {
  width: clamp(350px, 34vw, 460px);
  aspect-ratio: 900 / 667;
  height: auto;
  position: relative;
  --paper-pitch: 52deg;
  --rest-pose: perspective(1500px) rotate(-3deg) rotateX(var(--paper-pitch));
}
.top-note {
  z-index: 2;
  background: none;
  border: 0;
  width: 100%;
  height: 100%;
  position: absolute;
  padding: 0;
  inset: 0;
  outline-offset: 10px !important;
}
.paper-face,
.under-paper {
  position: absolute;
  inset: 0;
  background: var(--paper) center/100% 100% no-repeat;
  transform: var(--rest-pose);
  transform-origin: center center;
}
.under-paper {
  filter: brightness(0.87);
  pointer-events: none;
}
.under-paper.one {
  transform: translate(1px, 2px) perspective(1500px) rotate(-2.7deg)
    rotateX(var(--paper-pitch));
  filter: brightness(0.84) drop-shadow(1px 2px 1px #30261580)
    drop-shadow(5px 7px 5px #30261550);
}
.under-paper.two {
  transform: translate(-0.5px, 1.25px) perspective(1500px) rotate(-3.4deg)
    rotateX(var(--paper-pitch));
  filter: brightness(0.92);
}
.under-paper.three {
  transform: translate(0, 0.5px) perspective(1500px) rotate(-3.1deg)
    rotateX(var(--paper-pitch));
  filter: brightness(0.96);
}
.paper-face {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14% 14% 18%;
  color: #302e27;
  font:
    400 clamp(21px, 2vw, 29px)/1.5 Lora,
    serif;
  text-align: center;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}
.paper-face.dense {
  font-size: clamp(17px, 1.6vw, 23px);
}
.paper-mark {
  position: absolute;
  bottom: 13%;
  right: 13%;
  width: 27px;
  height: 30px;
  object-fit: contain;
  opacity: 0.45;
}
.paper-source {
  font:
    12px Source,
    sans-serif;
  position: absolute;
  bottom: 14%;
  left: 14%;
  text-align: left;
  white-space: normal;
  max-width: 63%;
  color: #655f51;
}
.lift-label {
  position: absolute;
  bottom: -42px;
  left: 0;
  width: 100%;
  font:
    15px Source,
    sans-serif;
  color: #f8f3e8;
  text-shadow:
    0 1px 6px #181d13,
    0 1px 3px #181d13;
}
.browse {
  position: absolute;
  top: calc(56% + 30px);
  left: calc(50% - min(27vw, 375px));
  right: calc(50% - min(27vw, 375px));
  display: flex;
  justify-content: space-between;
  pointer-events: none;
}
.browse button {
  pointer-events: auto;
  background: #ede7dac9;
  border-radius: 50%;
}
.bank-footer {
  position: absolute;
  bottom: 28px;
  left: 5vw;
  right: 5vw;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  color: #f8f3e8;
}
.bank-footer .quiet {
  background: transparent;
  border-radius: 2px;
  padding: 12px 20px;
}
.bank-footer .quiet:hover {
  color: #fff;
  background: transparent;
}
.bank-footer p {
  font-size: 14px;
  margin: 0;
  background: #283326ed;
  padding: 8px 12px;
}
.bank-footer p:empty {
  display: none;
}
.bank-footer #room-status {
  max-width: 500px;
}
#empty {
  background: #f0e9dce8;
  padding: 25px;
  text-align: center;
  font:
    20px/1.5 Lora,
    serif;
}
#empty p {
  margin: 8px 0;
}
.no-script {
  position: relative;
  padding: 20px;
  background: #eee7d9;
}
#desk {
  position: fixed;
  inset: 0;
  max-width: none;
  max-height: none;
  width: 100%;
  height: 100%;
  border: 0;
  margin: 0;
  padding: 24px 32px 40px;
  background: transparent;
  color: #302e27;
  overflow: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
}
#desk[open] {
  display: flex;
  flex-direction: column;
  align-items: center;
}
#desk::backdrop {
  background: #e8e1d365;
  backdrop-filter: blur(3px);
}
.desk-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: min(100%, 960px);
  margin-bottom: 12px;
  flex-shrink: 0;
}
.held-paper {
  z-index: 1;
  position: relative;
  width: min(630px, 95%);
  min-height: 430px;
  flex-shrink: 0;
  margin: auto 0 12px;
  filter: drop-shadow(2px 16px 18px #30251840);
}
.sheet-material {
  position: absolute;
  inset: 0;
  background: var(--paper) center/100% 100% no-repeat;
  z-index: -1;
}
.sheet-content {
  padding: 65px 75px 56px;
  min-height: 430px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.sheet-content p {
  font:
    400 30px/1.55 Lora,
    serif;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 20px 0 30px;
}
.sheet-content p.dense {
  font-size: 24px;
}
.signature {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 13px;
  color: #635b4f;
  margin-top: auto;
  padding-top: 8px;
}
.signature img {
  width: 26px;
  height: 28px;
  object-fit: contain;
  margin-left: auto;
  opacity: 0.6;
}
.desk-foot {
  width: min(520px, 100%);
  margin: 0 auto auto;
  flex-shrink: 0;
}
.read-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}
.small {
  font-size: 14px;
  line-height: 1.55;
  color: #59554a;
}
#keep-help {
  margin: 10px 0 0;
  text-align: left;
}
#feedback {
  font-size: 15px;
  line-height: 1.5;
  margin: 10px 12px 0;
}
#feedback:empty {
  display: none;
}
#feedback.error {
  color: #793c2a;
}
.sheet-content textarea {
  width: 100%;
  resize: vertical;
  min-height: 190px;
  max-height: 420px;
  background: transparent;
  border: 0;
  font:
    24px/1.6 Lora,
    serif;
  color: #302e27;
  margin: 12px 0;
  overflow-wrap: anywhere;
  border-radius: 0;
}
.sheet-content textarea::placeholder {
  color: #766e5f;
  font-size: 21px;
}
#draft-label {
  font-size: 14px;
  color: #625b4f;
}
.paper-choices {
  display: flex;
  gap: 25px;
  align-items: center;
  border: 0;
  padding: 0 12px;
  margin: 0;
}
.paper-choices legend {
  float: left;
  margin-right: 25px;
  font-size: 14px;
  line-height: 44px;
}
.paper-choices label {
  display: flex;
  gap: 6px;
  align-items: center;
  min-height: 44px;
  font-size: 14px;
  cursor: pointer;
}
.paper-choices input {
  accent-color: #536549;
}
.swatch {
  display: none;
}
.paper-choices .swatch.lichen {
  background: #b9c1a8;
}
#compose .small {
  margin: 8px 12px;
}
.action {
  font-weight: 600;
}
.consent {
  display: flex;
  gap: 12px;
  font-size: 15px;
  line-height: 1.5;
  align-items: flex-start;
  min-height: 44px;
  padding: 10px 12px;
}
.consent input {
  margin-top: 4px;
  flex-shrink: 0;
  accent-color: #536549;
}
#publish-context {
  margin: 5px 12px;
}
#simulation-controls {
  margin: 20px 12px 0;
  color: #59554a;
  font-size: 13px;
}
#simulation-controls summary {
  min-height: 32px;
  cursor: pointer;
}
#simulation-controls select {
  font: inherit;
  max-width: 100%;
  margin: 8px;
}
#desk[data-mode="write"] .held-paper {
  margin-top: 0;
}
#desk[data-mode="write"] .sheet-content {
  min-height: 410px;
}
.paper-face[data-paper="lichen"],
.held-paper[data-paper="lichen"] .sheet-material {
  filter: sepia(0.1) hue-rotate(28deg) saturate(0.8);
}
.paper-face[data-paper="mist"],
.held-paper[data-paper="mist"] .sheet-material {
  filter: saturate(0.2);
}
.paper-failed .paper-face,
.paper-failed .under-paper,
.paper-failed .sheet-material {
  background: #eee5d3;
  border-radius: 1px;
}
.paper-failed .under-paper {
  border-bottom: 1px solid #c3b69d;
}
#about,
#safety {
  background: #f2ecdf;
  color: #302e27;
  border: 0;
  padding: 32px;
  max-width: min(480px, calc(100% - 32px));
  max-height: calc(100% - 32px);
  overflow: auto;
  box-shadow: 0 18px 80px #0004;
  font:
    16px/1.6 Source,
    sans-serif;
}
#about h2 {
  font:
    26px/1.4 Lora,
    serif;
}
#about-close {
  float: right;
}
#about h2 {
  clear: both;
  padding-top: 15px;
}
#about::backdrop {
  background: #252a2370;
}
#safety h3 {
  font:
    22px/1.4 Lora,
    serif;
}
body.desk-open #top-paper {
  visibility: hidden;
}
body.desk-open {
  overflow: hidden;
}
@media (max-width: 700px) {
  .header {
    padding: 22px 22px;
  }
  .brand {
    font-size: 29px;
    gap: 9px;
  }
  .brand img {
    width: 26px;
    height: 34px;
  }
  .header .quiet {
    font-size: 13px;
    padding: 10px 8px;
  }
  .intro {
    top: 115px;
    left: 28px;
    max-width: 280px;
  }
  .intro h1 {
    font-size: 21px;
  }
  .intro p {
    font-size: 14px;
  }
  .bank {
    height: 100svh;
    min-height: 720px;
    padding-top: 70px;
  }
  .stack {
    width: calc(100vw - 80px);
    height: auto;
    max-width: 450px;
    max-height: none;
  }
  .paper-face {
    font-size: 21px;
    padding: 14% 13% 21%;
  }
  .paper-face.dense {
    font-size: 17px;
  }
  .paper-source {
    font-size: 10px;
    bottom: 13%;
  }
  .paper-mark {
    width: 22px;
    height: 24px;
    right: 12%;
    bottom: 12%;
  }
  .browse {
    top: calc(50% + 16px);
    left: 4px;
    right: 4px;
  }
  .browse button {
    background: #eee7d2c9;
  }
  .lift-label {
    bottom: -40px;
    font-size: 14px;
  }
  .bank-footer {
    bottom: 30px;
  }
  .bank-footer .quiet {
    font-size: 14px;
  }
  .scene {
    object-position: 50% 54%;
  }
  #desk {
    padding: 14px 12px 28px;
  }
  .desk-head {
    margin: 0 0 10px;
    min-height: 44px;
  }
  .desk-head .quiet {
    font-size: 14px;
    padding-left: 8px;
  }
  .held-paper {
    width: 100%;
    min-height: 340px;
    margin: auto 0 12px;
  }
  .sheet-content {
    padding: 44px 34px 35px;
    min-height: 340px;
  }
  .sheet-content p {
    font-size: 25px;
    line-height: 1.5;
    margin: 16px 0 25px;
  }
  .sheet-content p.dense {
    font-size: 20px;
  }
  .signature {
    font-size: 11px;
    gap: 8px;
  }
  .signature img {
    width: 22px;
    height: 24px;
  }
  .desk-foot {
    width: 100%;
  }
  .read-actions {
    gap: 0;
  }
  .read-actions .quiet {
    font-size: 14px;
    gap: 8px;
  }
  .small {
    font-size: 13px;
  }
  #keep-help {
    font-size: 12px;
  }
  #desk[data-mode="write"] .held-paper {
    margin-top: 8px;
  }
  #desk[data-mode="write"] .sheet-content {
    min-height: 340px;
  }
  .sheet-content textarea {
    font-size: 21px;
    min-height: 170px;
  }
  .sheet-content textarea::placeholder {
    font-size: 19px;
  }
  .paper-choices {
    gap: 12px;
    justify-content: space-between;
  }
  .paper-choices legend {
    margin-right: 8px;
  }
  .paper-choices label {
    gap: 4px;
    font-size: 13px;
  }
  .consent {
    font-size: 14px;
  }
}
@media (max-width: 350px) {
  .header {
    padding: 18px;
  }
  .header .quiet {
    font-size: 12px;
  }
  .intro {
    left: 24px;
    top: 105px;
  }
  .intro h1 {
    font-size: 20px;
  }
  .stack {
    width: calc(100vw - 60px);
    height: auto;
  }
  .paper-face {
    font-size: 18px;
  }
  .paper-face.dense {
    font-size: 16px;
  }
  .sheet-content {
    padding: 35px 28px;
    min-height: 350px;
  }
  .sheet-content p.dense {
    font-size: 18px;
  }
  .read-actions .quiet {
    font-size: 13px;
    gap: 5px;
  }
  .paper-choices {
    gap: 3px;
  }
  .paper-choices legend {
    display: none;
  }
}
@media (max-height: 730px) and (min-width: 701px) {
  .intro {
    top: 115px;
  }
  .intro h1 {
    font-size: 22px;
  }
  .stack {
    width: 400px;
    height: auto;
  }
  .bank {
    padding-top: 240px;
  }
  .held-paper {
    margin-top: 0;
  }
  .sheet-content {
    min-height: 360px;
    padding: 45px 65px;
  }
  .held-paper {
    min-height: 360px;
    width: 540px;
  }
  .sheet-content p {
    font-size: 26px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
  }
}

/* Keep the place visible while the paper takes focus. */
body.desk-open .intro,
body.desk-open .header,
body.desk-open .bank-footer,
body.desk-open .browse,
body.desk-open .lift-label {
  visibility: hidden;
}
.bank-footer::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: -30px -5vw -28px;
  background: linear-gradient(transparent, #172317ad);
  pointer-events: none;
}
.bank-footer .quiet {
  text-shadow: 0 1px 4px #14200e;
}
#desk::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: 110px;
  background: linear-gradient(#eee8dfd9, transparent);
  pointer-events: none;
  z-index: -1;
}
.sheet-content p {
  margin: auto 0;
  padding: 10px 0 25px;
}
.signature {
  margin-top: 20px;
}
.desk-foot {
  background: radial-gradient(ellipse at center, #eee7dacc 30%, #eee7da00 72%);
}
#desk[data-mode="read"] #simulation-controls {
  display: none;
}

main {
  position: relative;
  overflow-x: clip;
}
/* The resting sheet invites reading; long thoughts are complete in the reader. */
.paper-face > span:first-child {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
  overflow: hidden;
}
@media (max-width: 700px) {
  .paper-face > span:first-child {
    -webkit-line-clamp: 4;
  }
}

#about-close {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f2ecdf;
}
.lift-label {
  height: 24px;
  line-height: 24px;
}

.paper-face[data-paper="lichen"],
.held-paper[data-paper="lichen"] .sheet-material {
  background-color: #dae1c9;
  background-blend-mode: multiply;
  mask-image: var(--paper);
  mask-size: 100% 100%;
  filter: none;
}
.paper-face[data-paper="mist"],
.held-paper[data-paper="mist"] .sheet-material {
  background-color: #dce8e6;
  background-blend-mode: multiply;
  mask-image: var(--paper);
  mask-size: 100% 100%;
  filter: none;
}

/* The phone plate preserves Haru across the water rather than cropping a wide scene. */
@media (max-width: 900px) {
  .scene {
    object-position: right center;
  }
}
@media (max-width: 700px) {
  .intro {
    max-width: 185px;
  }
  .intro h1 {
    font-size: 19px;
  }
  .intro p {
    max-width: 170px;
  }
  .bank {
    padding-top: 240px;
  }
  .browse {
    top: calc(50% + 72px);
  }
}

.bank-copy {
  position: fixed !important;
  margin: 0 !important;
  min-height: 0 !important;
  pointer-events: none;
  z-index: 4;
}
body[data-identity="hidden"] .brand,
body[data-identity="hidden"] .paper-source,
body[data-identity="hidden"] .paper-mark,
body[data-identity="hidden"] .signature {
  visibility: hidden;
}

/* Scenery and resting paper share a document coordinate space on short screens. */
body {
  position: relative;
}
.scene {
  position: absolute;
}
@media (max-width: 350px) {
  .intro {
    max-width: 130px;
  }
  .intro p {
    max-width: 120px;
    font-size: 13px;
  }
}
@media (max-width: 700px) and (orientation: landscape) {
  .header {
    justify-content: flex-start;
    gap: 24px;
  }
  .bank {
    padding-top: 220px;
  }
  .browse {
    top: calc(50% + 92px);
  }
}
.top-note,
#desk[data-mode="read"] .held-paper {
  touch-action: pan-y pinch-zoom;
}
.top-note.dragging,
#desk[data-mode="read"] .held-paper.dragging {
  cursor: grabbing;
  user-select: none;
}
.turning-sheet {
  pointer-events: none;
  z-index: 5;
}
@media (max-width: 700px) and (max-height: 650px) {
  .lift-label {
    top: -36px;
    bottom: auto;
  }
}

/* A writing stone, separate from the closer reading encounter. The scenery and
   sheet share the dialog's scrolling coordinates, including short screens. */
.writing-place {
  display: none;
}
#desk[data-mode="write"] {
  isolation: isolate;
  padding-bottom: 44px;
  background: #a1967f;
}
#desk[data-mode="write"]::before {
  display: none;
}
#desk[data-mode="write"] .writing-place {
  display: block;
  position: absolute;
  inset: 0 0 auto;
  height: max(100%, 960px);
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(transparent 68%, #a1967f 98%),
    url("/assets/hotori/writer-bank-desktop.webp") center top / cover no-repeat;
}
#desk[data-mode="write"] .desk-head {
  width: 100%;
  margin: 0;
}
#desk[data-mode="write"] #return {
  color: #fff7e5;
  text-shadow: 0 1px 5px #172013;
  background: radial-gradient(ellipse, #243020a8, transparent 72%);
}
#desk[data-mode="write"] .held-paper {
  width: min(620px, 100%);
  min-height: 410px;
  margin: clamp(210px, 25vh, 290px) 0 0;
  filter: drop-shadow(2px 9px 5px #30251862);
}
#desk[data-mode="write"] .sheet-content {
  padding: 55px 66px 45px;
  min-height: 410px;
}
#desk[data-mode="write"] .sheet-content textarea {
  resize: vertical;
  font-size: 24px;
  line-height: 1.6;
  min-height: 190px;
  padding: 0 0 0 12px;
  border-left: 2px solid transparent;
}
#desk[data-mode="write"] .sheet-content textarea:focus-visible {
  outline: none;
  border-left-color: #647055;
}
#desk[data-mode="write"] .desk-foot {
  position: relative;
  width: min(580px, 100%);
  margin: -25px auto 0;
  background: none;
}
#compose {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  column-gap: 24px;
}
#compose .paper-choices legend {
  display: block;
}
#compose .paper-choices {
  grid-column: 1;
  grid-row: 1;
  gap: 3px;
  justify-content: flex-start;
  padding: 0;
}
.paper-choices label {
  position: relative;
  width: 78px;
  min-height: 66px;
  display: block;
}
.paper-choices input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  z-index: 1;
  cursor: pointer;
  opacity: 0;
}
.paper-choices .sample {
  display: flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  inset: 0 0 5px;
  background: var(--paper) center / 100% 100% no-repeat;
  filter: drop-shadow(0 3px 2px #34291c65);
  transform: rotate(-5deg);
  transition: transform 180ms var(--ease);
  color: #302e27;
  font-size: 13px;
}
.paper-choices .sample.lichen {
  transform: rotate(2deg);
  background-color: transparent;
}
.paper-choices .sample.mist {
  transform: rotate(6deg);
}
.paper-choices .sample::before {
  content: "";
  position: absolute;
  inset: 10% 8%;
  background: transparent;
  mix-blend-mode: multiply;
}
.paper-choices .sample.lichen::before {
  background: #b7c19e;
  opacity: 0.65;
}
.paper-choices .sample.mist::before {
  background: #b5bfc3;
  opacity: 0.4;
}
.paper-choices .sample span {
  position: relative;
  padding-top: 8px;
}
.paper-choices input:checked + .sample {
  transform: translateY(6px);
}
.paper-choices input:checked + .sample span::after {
  content: "";
  display: block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  margin: 3px auto -7px;
  background: currentColor;
}
.paper-choices input:focus-visible + .sample {
  outline: 2px solid #34442c;
  outline-offset: 3px;
}
#compose #review {
  grid-column: 2;
  grid-row: 1;
  position: relative;
  z-index: 2;
  margin: -60px 12px 0 0;
  font:
    400 15px/1.4 Lora,
    serif;
  padding: 12px 18px;
  background: none;
}
#review svg {
  display: none;
}
#desk[data-mode="write"] #draft-help {
  margin: 8px 0 0;
  padding: 0;
  white-space: normal;
  font:
    400 13px/1.5 Source,
    sans-serif;
  color: #504b40;
}
#desk[data-mode="write"] .sheet-content textarea {
  height: 190px;
}
#desk[data-mode="write"] #sharing {
  margin-top: 18px;
  padding-top: 10px;
  border-top: 1px solid #8e856859;
}
#sharing .consent {
  padding: 10px 0;
}
#sharing #publish-context {
  font:
    400 12px/1.5 Source,
    sans-serif;
  margin: 8px 0 0;
  padding: 0;
  white-space: normal;
}
#desk[data-mode="write"][data-stage="review"] .held-paper {
  margin-top: clamp(100px, 15vh, 180px);
}
#desk[data-mode="write"][data-stage="review"] .sheet-content {
  min-height: 410px;
}
#desk[data-mode="write"] #feedback,
#desk[data-mode="write"] #publish-context,
#desk[data-mode="write"] #simulation-controls {
  color: #302e27;
}
#desk[data-mode="write"] #feedback.error {
  color: #652c1f;
  background: #f0e6d9;
  padding: 8px 12px;
}
#desk[data-mode="write"][data-stage="review"] .desk-foot {
  margin-top: 12px;
  background: none;
}
@media (max-width: 700px) {
  #desk[data-mode="write"] {
    padding: 14px 12px 40px;
  }
  #desk[data-mode="write"] .writing-place {
    height: max(100%, 900px);
    background:
      linear-gradient(transparent 68%, #a1967f 98%),
      url("/assets/hotori/writer-bank-phone.webp") right top / cover no-repeat;
  }
  #desk[data-mode="write"] .held-paper {
    width: 100%;
    margin-top: 225px;
    min-height: 340px;
  }
  #desk[data-mode="write"] .sheet-content {
    padding: 38px 32px 32px;
    min-height: 340px;
  }
  #desk[data-mode="write"] .sheet-content textarea {
    min-height: 175px;
    height: 175px;
    font-size: 20px;
    margin: 14px 0;
  }
  #desk[data-mode="write"] .sheet-content textarea::placeholder {
    font-size: 18px;
  }
  #desk[data-mode="write"] .signature {
    margin-top: 12px;
    font-size: 12px;
  }
  #compose {
    column-gap: 7px;
  }
  .paper-choices label {
    width: 62px;
    min-height: 64px;
  }
  #compose #review {
    font-size: 13px;
    padding: 12px;
  }
  #compose #draft-help {
    font-size: 13px;
    margin-top: 18px;
  }
}
@media (max-width: 350px) {
  .paper-choices label {
    width: 54px;
  }
  #compose #review {
    padding: 12px 8px;
  }
  #desk[data-mode="write"] .sheet-content {
    padding: 36px 27px 30px;
  }
}
@media (prefers-reduced-motion: reduce) {
  .paper-choices .sample {
    transition: none;
  }
}
body[data-still="true"] .paper-choices .sample {
  transition: none;
}

#desk[data-mode="write"][data-stage="compose"] .signature img {
  visibility: hidden;
}

@media (max-width: 700px) {
  #desk[data-mode="write"][data-stage="review"] .held-paper {
    margin-top: 95px;
  }
  #desk[data-mode="write"] #sharing .read-actions {
    flex-wrap: wrap;
  }
  #desk[data-mode="write"] #sharing .quiet {
    padding-left: 0;
    padding-right: 0;
  }
  #desk[data-mode="write"] #sharing .consent {
    font-size: 13px;
  }
}
@media (max-height: 650px) {
  #desk[data-mode="write"] .held-paper {
    margin-top: 65px;
  }
  #desk[data-mode="write"][data-stage="review"] .held-paper {
    margin-top: 25px;
  }
}
/* Reading back brings the sheet toward the viewer; the far bank falls out of focus. */
#desk[data-mode="write"][data-stage="review"] .writing-place {
  filter: blur(8px);
  opacity: 0.55;
}
.paper-failed .paper-choices .sample {
  background: #efe6d5;
}

/* Ink belongs to the paper. The stable navigation plane matches its rest pose,
   with tall hit areas to retain a generous target after perspective projection. */
.paper-face {
  padding: 12% 14% 22%;
}
.paper-source {
  bottom: 21%;
  font-size: 14px;
  color: #504a3e;
}
.paper-mark {
  bottom: 21%;
}
.paper-face .lift-label {
  top: calc(87% - 12px);
  bottom: auto;
  height: 24px;
  line-height: 24px;
  font-size: 17px;
  color: #090c08;
  text-shadow: none;
}
.stack > .browse {
  z-index: 3;
  inset: 0;
  display: block;
}
.browse-plane {
  position: absolute;
  inset: 0;
  transform: var(--rest-pose);
}
.browse button {
  position: absolute;
  top: calc(87% - 35px);
  width: 64px;
  height: 70px;
  padding: 0;
  background: transparent;
  border-radius: 0;
  color: #090c08;
  filter: none;
}
.browse #previous {
  left: 5%;
}
.browse #next {
  right: 5%;
}
.browse button svg {
  width: 24px;
  height: 24px;
  stroke-width: 1.7;
}
.browse button:focus-visible {
  outline-color: #42523d;
  outline-offset: -8px;
}
.browse button:hover {
  color: #090c08;
}
@media (max-width: 700px) {
  .stack {
    --paper-pitch: 44deg;
  }
  .paper-face {
    font-size: 21px;
  }
  .paper-face.dense {
    font-size: 18px;
  }
  .paper-source {
    font-size: 13px;
  }
  .paper-face .lift-label {
    font-size: 14px;
  }
  .browse #previous {
    left: 2%;
  }
  .browse #next {
    right: 2%;
  }
}
/* A short phone keeps the full invitation within reach without cropping Haru. */
@media (max-width: 700px) and (max-height: 650px) and (orientation: portrait) {
  .bank {
    min-height: 568px;
    padding-top: 150px;
  }
  .bank-footer {
    bottom: 8px;
  }
}
/* A failed raster mask must never erase the words or their backing. */
.paper-failed .paper-face[data-paper],
.paper-failed .held-paper[data-paper] .sheet-material {
  mask-image: none;
  background: #eee5d3;
}

/* Connection feedback belongs to the active space, including modal views. */
#desk-connection {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  max-width: 44ch;
  margin: 8px 0 12px;
  padding: 10px 14px;
  background: #eee5d3;
  color: #302e27;
  font:
    400 14px/1.5 Source,
    sans-serif;
  text-align: center;
}

#desk-connection p {
  margin: 0;
}
#desk-connection .quiet {
  min-height: 44px;
  color: inherit;
}

/* Reading actions are quiet ink on the same sheet, not a second toolbar. */
#desk[data-mode="read"] .sheet-content {
  padding-bottom: 48px;
}
.reader-margin {
  margin-top: 24px;
}
.reader-margin .read-actions {
  gap: 16px;
  flex-wrap: wrap;
}
.reader-margin .quiet {
  padding: 0;
  min-height: 44px;
  font-size: 14px;
  color: #090c08;
}
.reader-margin .quiet svg {
  width: 18px;
  height: 18px;
}
.sheet-content .copy-help {
  font:
    400 13px/1.5 Source,
    sans-serif;
  color: #090c08;
  padding: 0;
  white-space: normal;
}
#desk[data-mode="read"] .desk-foot {
  background: none;
}
@media (max-width: 700px) {
  #desk[data-mode="read"] .sheet-content {
    padding: 40px 28px 48px;
  }
  .reader-margin {
    margin-top: 20px;
  }
  .reader-margin .read-actions {
    gap: 4px 12px;
  }
  .reader-margin .quiet {
    font-size: 13px;
    gap: 6px;
  }
  .sheet-content .copy-help {
    font-size: 12px;
  }
}

#desk[data-mode="read"] .signature {
  color: #090c08;
}
/* The lifted sheet catches more light than the stack on the shaded stone. */
#desk[data-mode="read"] .sheet-material {
  filter: brightness(1.1);
}

/* Keep the resting sheet's material proportions at every breakpoint. A shared
   projection places the material, ink and controls in one plane; thin offsets
   describe loose sheets. The lifted view restores face-on reading. */
.paper-face::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    125deg,
    #fff8df26 5%,
    transparent 45%,
    #6c603b0a 100%
  );
  mask: var(--paper) center / 100% 100% no-repeat;
}
.paper-face[data-paper="lichen"] {
  background-color: #f1f1e5;
}
.paper-face[data-paper="mist"] {
  background-color: #edf0eb;
}

/* Scene-integrated paper: only the ink is an HTML layer. The photographed
   material supplies its own folds, light and contact with the stone. */
.scene {
  object-position: center;
}
.scene-integrated .stack {
  position: absolute;
  left: 0;
  top: 0;
  width: 600px;
  height: 240px;
  max-width: none;
  max-height: none;
  aspect-ratio: auto;
  transform: var(--scene-matrix);
  transform-origin: 0 0;
  --rest-pose: none;
}
.scene-integrated .under-paper {
  display: none;
}
.scene-integrated .paper-face[data-paper] {
  background: none;
  mask: none;
  filter: none;
  transform: none;
  padding: 35px 70px;
  font:
    400 38px/1.35 Lora,
    serif;
  color: #39382f;
}
.scene-integrated .paper-face.dense {
  font-size: 32px;
}
.scene-integrated .paper-face::before {
  display: none;
}
.scene-integrated .paper-face > span:first-child {
  -webkit-line-clamp: 3;
}
.scene-integrated .paper-source,
.scene-integrated .paper-mark,
.scene-integrated .lift-label {
  display: none;
}
.bank-footer .browse {
  position: static;
  display: block;
}
.bank-footer .browse-plane {
  position: static;
  inset: auto;
  display: flex;
  transform: none;
}
.bank-footer .browse button {
  position: static;
  width: 44px;
  height: 44px;
  background: none;
  color: inherit;
}
.bank-footer {
  gap: 2px 10px;
}
.bank-footer #read-open {
  padding: 10px 6px;
}
.bank-footer #write {
  padding: 10px 6px;
}
@media (max-width: 600px) {
  .bank-footer {
    left: 16px;
    right: 16px;
    bottom: 20px;
  }
  .bank-footer .quiet {
    font-size: 14px;
  }
}

.scene-integrated #empty {
  position: absolute;
  left: 0;
  top: 0;
  width: 600px;
  height: 240px;
  padding: 44px 55px;
  background: none;
  color: #39382f;
  font:
    400 32px/1.35 Lora,
    serif;
  transform: var(--scene-matrix);
  transform-origin: 0 0;
}

/* The same photographed sheet rises from its stone; the place stays present. */
#desk.shared-paper::backdrop {
  background: transparent;
  backdrop-filter: none;
}
#desk.shared-paper::before {
  display: none;
}
#desk.shared-paper .held-paper {
  transform-origin: 0 0;
}
.scene-sheet-material {
  display: none;
}
#desk.shared-paper .sheet-material {
  visibility: hidden;
}
#desk.shared-paper .scene-sheet-material {
  display: block;
  position: absolute;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}
.scene-sheet-material img {
  position: absolute;
  left: 0;
  top: 0;
  max-width: none;
  transform-origin: 0 0;
}
#desk.shared-paper :is(#read-words, .continuous-words) {
  text-align: center;
}
#desk.shared-paper .desk-head {
  color: #272a20;
}
#desk.paper-in-flight .sheet-content,
#desk.paper-in-flight .desk-head,
#desk.paper-in-flight .desk-foot {
  visibility: hidden;
}
#desk.paper-in-flight .held-paper {
  will-change: transform;
}
#desk.shared-paper .held-paper {
  width: min(600px, 100%);
  min-height: 300px;
  margin-bottom: 0;
}
#desk.shared-paper .sheet-content {
  min-height: 300px;
  padding: 42px 58px 28px;
}
#desk.shared-paper :is(#read-words, .continuous-words) {
  margin: auto 0;
  padding: 16px 0 24px;
}
#desk.shared-paper .signature {
  margin-top: 0;
}
#desk.shared-paper .reader-margin {
  margin-top: 18px;
}
#desk.shared-paper .desk-foot {
  width: min(540px, 100%);
}
#desk.shared-paper .reader-margin .quiet,
#desk.shared-paper .copy-help {
  color: #fffaf0;
  text-shadow:
    0 1px 3px #182012,
    0 1px 8px #182012;
}
#desk.shared-paper .copy-help {
  font:
    400 12px/1.5 Source,
    sans-serif;
  text-align: center;
}
@media (max-width: 700px) {
  #desk.shared-paper .held-paper,
  #desk.shared-paper .sheet-content {
    min-height: 240px;
  }
  #desk.shared-paper .sheet-content {
    padding: 30px 28px 24px;
  }
  #desk.shared-paper .desk-foot {
    width: calc(100% - 24px);
  }
}
#desk.shared-paper .scene-sheet-material {
  mask: url("/assets/hotori/quiet-bank-sheet-edge.svg") center / 100% 100%
    no-repeat;
}
.paper-failed #desk.shared-paper .scene-sheet-material {
  mask: none;
}
/* Opening the top-layer reader must not move the photograph underneath it. */
html {
  scrollbar-gutter: stable;
}

/* Only the moving mesh is visual; the single accessible quote stays in place. */
#desk.paper-bending #held-paper > .scene-sheet-material,
#desk.paper-bending #held-paper > .sheet-content {
  visibility: hidden;
}
#desk.paper-bending #held-paper {
  filter: none;
}
.paper-bend {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.paper-band {
  position: absolute;
  left: 0;
  top: 0;
  overflow: hidden;
  transform-origin: 0 0;
  will-change: transform;
}
#desk.shared-paper .bend-copy {
  position: absolute;
  left: 0;
  min-height: 0;
  margin: 0;
  filter: none;
  transform: none;
}
#desk.paper-in-flight .bend-copy .sheet-content {
  visibility: visible;
}
#desk.paper-in-flight .bend-copy .signature {
  visibility: hidden;
}
.paper-cast-shadow {
  position: fixed;
  left: 0;
  top: 0;
  width: 600px;
  height: 240px;
  transform-origin: 0 0;
  background: none;
  border-radius: 4%;
  pointer-events: none;
  z-index: 0;
}
/* Close reading needs resolved fibres, not magnified scenery pixels. Keep the
   detail's natural proportions; long/portrait sheets crop rather than stretch. */
.scene-sheet-material img.paper-detail {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: none;
}

/* Resolve fine fibres under the photographed sheet's own broad illumination.
   This layer travels with the paper; it never tints the live words. */
.paper-closeup,
.paper-scene-light {
  position: absolute;
  inset: 0;
  overflow: hidden;
  isolation: isolate;
}
.paper-closeup img.paper-detail {
  /* Use the quiet right-hand fibres; avoid importing a second leaf shadow. */
  transform: scale(1.45);
  transform-origin: right center;
  filter: saturate(0.65) brightness(1.06);
}
.paper-scene-light {
  mix-blend-mode: multiply;
  filter: blur(4px) brightness(1.12);
  opacity: 0.65;
}
#desk.shared-paper .held-paper {
  filter: drop-shadow(0 0.8px 0.35px rgba(244, 231, 204, 0.6))
    drop-shadow(4px 6px 9px rgba(48, 37, 24, 0.14));
}
#desk.shared-paper .bend-copy {
  filter: none;
}
.paper-cast-shadow::before {
  content: "";
  position: absolute;
  inset: 0;
  background: #211b12;
  mask: url("/assets/hotori/quiet-bank-sheet-edge.svg") center / 100% 100%
    no-repeat;
}

.paper-edge-failed #desk.shared-paper .scene-sheet-material {
  mask: var(--paper) center / 100% 100% no-repeat;
}
.paper-edge-failed .paper-cast-shadow::before {
  mask: none;
}
.paper-edge-failed .paper-failed #desk.shared-paper .scene-sheet-material {
  mask: none;
}
