:root {
  --paper: #f1eee5;
  --ink: #524e42;
  --thin-ink: #776e5e;
  --wash: #9e937854;
  --edge: #ede9dc;
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 14px sans-serif;
}
.exhibit {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 520px;
  height: 100svh;
  background:
    radial-gradient(ellipse at 51% 38%, #f9f6ed 1%, transparent 62%),
    radial-gradient(ellipse at 6% 80%, #b7a3842c, transparent 39%),
    radial-gradient(ellipse at 96% 17%, #bbae7e24, transparent 40%),
    var(--paper);
}
.exhibit::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: 0.42;
  background-image: url("./desk-grain.webp");
  background-size: 670px;
  mix-blend-mode: multiply;
  z-index: -1;
}
.exhibit::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  opacity: 0.52;
  background:
    radial-gradient(ellipse at 0 7%, #b1b19b64, transparent 24%),
    radial-gradient(ellipse at 103% 92%, #baab816a, transparent 28%),
    radial-gradient(ellipse at 9% 101%, #a7b1a252, transparent 16%);
}
.stage {
  position: absolute;
  inset: 0;
  touch-action: pan-y;
}
.stage.over-book {
  cursor: pointer;
}
.stage.over-plant {
  cursor: pointer;
}
.stage.dragging {
  cursor: grabbing;
}
.stage:focus-visible {
  outline: 1px dashed var(--thin-ink);
  outline-offset: -9px;
}
#scene {
  width: 100%;
  height: 100%;
  display: block;
}
.quill {
  position: absolute;
  z-index: 2;
  top: 0;
  left: 0;
  width: clamp(115px, 17vw, 255px);
  height: auto;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.14s linear;
  transform-origin: 13.25% 96.09%;
  filter: drop-shadow(6px 8px 6px #5b533f36) drop-shadow(1px 2px 2px #54483521);
}
@media (prefers-reduced-motion: reduce) {
  .quill {
    transition: none;
  }
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  clip-path: inset(50%);
  white-space: nowrap;
  overflow: hidden;
}
@media (max-width: 720px) {
  .quill {
    width: clamp(80px, 24vw, 126px);
  }
}

.desk-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  pointer-events: none;
}
.desk-header {
  position: absolute;
  z-index: 3;
  top: clamp(21px, 4.5vh, 48px);
  left: 50%;
  translate: -50% 0;
  display: grid;
  justify-items: center;
  gap: 12px;
  white-space: nowrap;
}
.brand {
  margin: 0;
  display: flex;
  gap: 9px;
  align-items: center;
  color: #36372d;
  font:
    500 clamp(28px, 3.2vw, 39px) / 1 Georgia,
    serif;
  letter-spacing: -0.055em;
}
.brand img {
  width: 29px;
  height: 29px;
  border-radius: 7px;
}
.desk-header nav {
  display: flex;
  align-items: center;
  gap: 22px;
  color: var(--thin-ink);
  font-size: 13px;
  line-height: 1.4;
}
.desk-header nav a {
  color: inherit;
  text-decoration: none;
}
.desk-header nav a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 4px;
}
.desk-header nav a:focus-visible {
  outline: 1px solid var(--thin-ink);
  outline-offset: 4px;
}
/* 图标只有 15px：内边距把可点区域撑到 25px，负外边距抵掉，看上去的间距仍只由 nav 的 gap 决定 */
.source-link {
  display: inline-flex;
  padding: 5px;
  margin: -5px;
}
.source-link-icon {
  display: block;
  width: 15px;
  height: 15px;
  background: currentColor;
  mask: url("./github.svg") center / contain no-repeat;
}
.desk-header nav .source-link:focus-visible {
  outline-offset: 0;
  border-radius: 4px;
}
@media (max-width: 720px) {
  .desk-header {
    top: 8vh;
  }
  .brand img {
    width: 24px;
    height: 24px;
  }
  .desk-header nav {
    gap: 17px;
    font-size: 12px;
  }
}

#fallback,
#no-script {
  text-align: center;
  color: var(--ink);
}
#fallback a,
#no-script a {
  color: inherit;
  text-underline-offset: 3px;
}
#no-script {
  position: absolute;
  inset: 36% 16% auto;
}
.fallback-mode {
  height: auto;
  min-height: 100svh;
  padding: 132px 0 24px;
}
/* 桌面底边渐隐成纸色，接上下面的介绍区。z-index 0：盖住水渍、植物和 ::before/::after 的纹理（都是 -1），排在后面的书（#stage）仍在它上面 */
.desk-fade {
  position: absolute;
  inset: auto 0 0;
  z-index: 0;
  height: clamp(80px, 22vh, 200px);
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    transparent,
    color-mix(in srgb, var(--paper) 45%, transparent) 45%,
    color-mix(in srgb, var(--paper) 85%, transparent) 75%,
    var(--paper)
  );
}
.fallback-mode .desk-fade,
.fallback-mode .desk-art {
  display: none;
}
.fallback-mode #fallback {
  margin: 20px;
}
.fallback-mode .transcript {
  width: min(640px, calc(100% - 40px));
  margin: auto;
  line-height: 1.6;
}
.fallback-mode .transcript article {
  padding: 12px 0;
  border-bottom: 1px solid var(--wash);
}
#scene[hidden] {
  display: none;
}

/* 3D 日记下面的产品介绍：纯 HTML 文字，不靠脚本，搜索引擎和读屏直接读到 */
html {
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}
.about {
  width: min(720px, calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(56px, 9vh, 96px) 0 48px;
  font: 16px/1.7 Georgia, serif;
}
.about h2 {
  margin: 56px 0 16px;
  color: #36372d;
  font: 500 clamp(24px, 3vw, 30px) / 1.25 Georgia, serif;
  letter-spacing: -0.02em;
}
.about h2:first-child {
  margin-top: 0;
  font-size: clamp(28px, 4vw, 40px);
}
.about h3 {
  margin: 0 0 6px;
  color: #36372d;
  font: 600 17px/1.4 Georgia, serif;
}
.about p,
.about dd {
  margin: 0 0 12px;
}
.about a {
  color: inherit;
  text-underline-offset: 3px;
}
.about a:focus-visible,
.site-footer a:focus-visible {
  outline: 1px solid var(--thin-ink);
  outline-offset: 3px;
}
.about code {
  font: 0.9em ui-monospace, "SF Mono", Menlo, monospace;
}
.lede {
  font-size: 18px;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  align-items: center;
  margin-top: 24px;
}
.actions .primary {
  padding: 9px 18px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  text-decoration: none;
}
.actions .primary:hover {
  background: var(--edge);
}
.features {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 28px 32px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.features li {
  padding-top: 14px;
  border-top: 1px solid var(--wash);
}
.features p {
  color: var(--ink);
}
.steps {
  margin: 0;
  padding-left: 1.4em;
}
.steps li {
  margin-bottom: 12px;
}
.steps pre {
  margin: 8px 0 0;
  padding: 10px 14px;
  overflow-x: auto;
  border: 1px solid var(--wash);
  border-radius: 8px;
  background: var(--edge);
}
.faq dt {
  margin-top: 20px;
  color: #36372d;
  font-weight: 600;
}
.faq dd {
  margin-left: 0;
  color: var(--ink);
}
.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 22px;
  padding: 28px 16px 40px;
  border-top: 1px solid var(--wash);
  color: var(--ink);
  font-size: 13px;
}
.site-footer a {
  color: inherit;
  text-underline-offset: 3px;
}
