:root {
  color-scheme: light;
  --outer: 0px;
  --paper: #d8d6d0;
  --ink: #191613;
  --gold: #9f7740;
  --frame-line: rgba(75, 61, 43, .28);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
  background: var(--paper);
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  padding: 0;
  overflow: hidden;
  color: var(--ink);
  background: url("akai-video-paper-hires.png") center / cover;
  font-family: Georgia, "Times New Roman", serif;
}

body.cover-page {
  background:
    #e8ddc5
    url("cover/archivbuch-einband-hell-gespiegelt-v2.webp")
    center / cover no-repeat fixed;
}

body:not(.cover-page) {
  background:
    #4a2e1c
    url("subpages/akai-open-book-background-v3.png")
    center / cover no-repeat fixed;
}

.landing {
  position: relative;
  isolation: isolate;
  min-height: 100dvh;
  overflow: hidden;
  background: transparent;
  border: 0;
}

.landing::before {
  content: "";
  position: absolute;
  inset: 1.1rem;
  z-index: 3;
  border: 1px solid var(--frame-line);
  pointer-events: none;
}

.landing::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: rgba(0, 0, 0, .06);
}

.cover-page .landing::before {
  border-color: rgba(111, 79, 37, .22);
  box-shadow: inset 0 0 0 1px rgba(255, 250, 230, .12);
}

.cover-page .landing::after {
  background:
    radial-gradient(ellipse at 42% 47%, rgba(255, 250, 231, .08), transparent 58%),
    rgba(55, 35, 17, .015);
}

body:not(.cover-page) .landing::before,
body:not(.cover-page) .landing::after {
  display: none;
}

body:not(.cover-page) .archive-note {
  top: 5.4%;
  left: 5.25%;
  color: rgba(65, 43, 25, .72);
  text-shadow: 0 1px rgba(255, 246, 220, .38);
}

.archive-note {
  position: absolute;
  top: 2rem;
  left: 2.35rem;
  z-index: 5;
  font-size: .62rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  opacity: 1;
}

.stage-layout {
  position: absolute;
  inset: 4.25rem clamp(225px, 19vw, 275px) 3.8rem 2.4rem;
  z-index: 1;
  display: grid;
  grid-template-columns: clamp(234px, 22.5vw, 312px) minmax(0, 650px);
  align-items: center;
  justify-content: center;
  gap: clamp(.7rem, 1.4vw, 1.2rem);
}

.cover-page .stage-layout {
  inset: 0;
  display: block;
}

.portrait {
  width: 100%;
  aspect-ratio: .547;
  margin: 0;
  overflow: hidden;
  transform: translateX(calc(.75rem - 55%));
  filter: drop-shadow(0 8px 12px rgba(29, 20, 12, .2));
}

.cover-page .portrait {
  position: absolute;
  top: clamp(13.4rem, 30vh, 15rem);
  left: clamp(7.7rem, 10.5vw, 9rem);
  z-index: 3;
  width: clamp(325px, 27vw, 360px);
  aspect-ratio: .76;
  margin: 0;
  overflow: visible;
  transform:
    perspective(900px)
    rotateX(1.4deg)
    rotateY(-2.8deg)
    rotateZ(-4.1deg);
  transform-style: preserve-3d;
  filter:
    drop-shadow(15px 18px 13px rgba(55, 36, 17, .27))
    drop-shadow(2px 4px 2px rgba(43, 28, 14, .21));
}

.cover-page .portrait::before {
  content: none;
}

.portrait img {
  display: block;
  width: 105.7%;
  max-width: none;
  height: 102.5%;
  transform: translate(-2.7%, -1.2%);
}

.cover-page .portrait img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform: none;
}

.cover-page .motif-column {
  position: absolute;
  top: clamp(7rem, 18vh, 8.35rem);
  left: clamp(25rem, 33vw, 27rem);
  z-index: 3;
  width: clamp(420px, 35vw, 470px);
}

.cover-page .thread-hint {
  position: absolute;
  top: calc(100% + 4.1rem);
  left: 14%;
  width: 32%;
  margin: 0;
  opacity: .68;
}

.cover-prop {
  position: absolute;
  z-index: 2;
  display: block;
  height: auto;
  pointer-events: none;
  user-select: none;
}

.cover-feather {
  left: clamp(-2.2rem, -1.5vw, -.6rem);
  bottom: clamp(1.8rem, 5.5vh, 3rem);
  z-index: 1;
  width: clamp(500px, 44vw, 580px);
  filter:
    drop-shadow(7px 10px 7px rgba(42, 29, 16, .22))
    saturate(.94);
  transform: rotate(-55deg);
  transform-origin: 13% 82%;
}

.cover-jasmine {
  top: clamp(2.5rem, 6vh, 3.5rem);
  left: clamp(17.5rem, 24vw, 20rem);
  width: clamp(300px, 25vw, 340px);
  filter: drop-shadow(4px 7px 5px rgba(42, 29, 16, .17));
  transform: rotate(-3deg);
}

.cover-coins {
  right: auto;
  bottom: clamp(5rem, 13vh, 6.5rem);
  left: clamp(36rem, 50vw, 40rem);
  z-index: 3;
  width: clamp(172px, 15vw, 198px);
  filter:
    drop-shadow(4px 6px 4px rgba(42, 29, 16, .22))
    saturate(.96);
  transform: rotate(-1.6deg);
}

.motif-column {
  display: grid;
  min-width: 0;
  justify-items: center;
  gap: .2rem;
}

.motif {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 650px;
  aspect-ratio: 35 / 20;
}

.symbol-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.native-name {
  position: absolute;
  left: 50%;
  top: 83%;
  width: 76%;
  transform: translateX(-50%);
  opacity: 0;
  clip-path: inset(0 100% 0 0);
  transition: opacity .2s ease, clip-path 2s ease;
}

.cover-page .native-name {
  left: 45%;
  top: 86%;
  width: 68%;
}

.native-name.is-visible {
  opacity: 1;
  clip-path: inset(0);
}

.kanji-name {
  position: absolute;
  right: 5%;
  top: 0;
  height: 78%;
  opacity: 0;
  clip-path: inset(0 0 100% 0);
  transition: opacity .2s ease, clip-path 1.55s ease;
}

.cover-page .kanji-name {
  top: 2%;
  right: -1.5%;
  height: 75%;
}

.kanji-name.is-visible {
  opacity: 1;
  clip-path: inset(0);
}

.hanko {
  position: absolute;
  right: 3%;
  top: 64%;
  width: 18%;
  opacity: 0;
  transform: rotate(-4deg) scale(.92);
  transition: opacity .5s ease, transform .9s cubic-bezier(.2, .75, .22, 1);
}

.cover-page .hanko {
  top: 67%;
  right: -2.5%;
  width: 17%;
}

.hanko.is-visible {
  opacity: .92;
  transform: rotate(-4deg) scale(1);
}

.thread-hint {
  position: relative;
  top: .85rem;
  margin: clamp(5.8rem, 8vw, 6.6rem) 0 0;
  color: rgba(39, 32, 25, .78);
  font-family: "Segoe Print", "Bradley Hand", cursive;
  font-size: clamp(.8rem, 1.15vw, 1rem);
  letter-spacing: .04em;
  line-height: 1.2;
  text-align: center;
  opacity: 1;
}

.thread-hint::after {
  content: none;
}

.thread-band {
  position: absolute;
  z-index: 4;
  top: 1.55rem;
  right: 2.5rem;
  bottom: 1.55rem;
  width: clamp(240px, 21vw, 280px);
  box-sizing: border-box;
  padding-right: 0;
  display: flex;
  align-items: stretch;
  overflow: visible;
  opacity: 1;
}

.cover-page .thread-band {
  top: 3rem;
  right: clamp(4rem, 6.3vw, 5rem);
  bottom: 2.6rem;
  width: clamp(280px, 23.5vw, 310px);
}

.thread-band::before {
  content: "";
  position: absolute;
  top: .45rem;
  right: .1rem;
  left: .1rem;
  z-index: 0;
  height: 2px;
  background:
    linear-gradient(90deg, transparent, rgba(66, 45, 28, .5) 5%, rgba(141, 99, 48, .72) 45%, rgba(56, 39, 24, .52) 95%, transparent);
  box-shadow: 0 1px 1px rgba(255, 247, 222, .28);
  transform: rotate(.35deg);
}

.cover-page .thread-band::before {
  display: none;
}

.thread-strand {
  position: relative;
  display: block;
  flex: 1 1 0;
  min-width: 0;
  height: 100%;
  outline: none;
  z-index: var(--thread-layer, 1);
}

.thread-strand img {
  position: absolute;
  top: var(--thread-top, .2rem);
  left: 50%;
  display: block;
  width: var(--thread-width, 60px);
  height: calc(100% - var(--thread-top, .2rem) - var(--thread-bottom, 1rem));
  object-fit: fill;
  pointer-events: none;
  user-select: none;
  filter:
    drop-shadow(0 3px 2px rgba(37, 25, 16, .2))
    saturate(.96)
    contrast(1.02);
  transform: translateX(-50%) rotate(var(--thread-tilt, 0deg));
  transform-origin: 50% 0;
  transition: filter .22s ease, transform .24s cubic-bezier(.2, .72, .25, 1);
}

.thread-link:nth-child(1) {
  --thread-top: .05rem;
  --thread-bottom: .75rem;
  --thread-width: 78px;
  --thread-tilt: -.7deg;
  --thread-layer: 5;
  --thread-glow: rgba(149, 28, 41, .64);
}

.thread-link:nth-child(2) {
  --thread-top: .45rem;
  --thread-bottom: 2.15rem;
  --thread-width: 74px;
  --thread-tilt: .9deg;
  --thread-layer: 7;
  --thread-glow: rgba(38, 106, 67, .64);
}

.thread-link:nth-child(3) {
  --thread-top: .18rem;
  --thread-bottom: 1.45rem;
  --thread-width: 86px;
  --thread-tilt: -.4deg;
  --thread-layer: 4;
  --thread-glow: rgba(28, 135, 134, .66);
}

.thread-link:nth-child(4) {
  --thread-top: .38rem;
  --thread-bottom: .55rem;
  --thread-width: 84px;
  --thread-tilt: .55deg;
  --thread-layer: 8;
  --thread-glow: rgba(187, 91, 20, .68);
}

.thread-link:nth-child(5) {
  --thread-top: .72rem;
  --thread-bottom: 2.7rem;
  --thread-width: 76px;
  --thread-tilt: -1deg;
  --thread-layer: 6;
  --thread-glow: rgba(43, 70, 167, .7);
}

.thread-link:nth-child(6) {
  --thread-top: .12rem;
  --thread-bottom: 1.15rem;
  --thread-width: 91px;
  --thread-tilt: .35deg;
  --thread-layer: 9;
  --thread-glow: rgba(115, 111, 43, .68);
}

.thread-link:nth-child(7) {
  --thread-top: .5rem;
  --thread-bottom: .35rem;
  --thread-width: 79px;
  --thread-tilt: -.65deg;
  --thread-layer: 7;
  --thread-glow: rgba(82, 80, 78, .72);
}

.thread-link:nth-child(8) {
  --thread-top: .24rem;
  --thread-bottom: 2rem;
  --thread-width: 96px;
  --thread-tilt: 1deg;
  --thread-layer: 10;
  --thread-glow: rgba(180, 130, 24, .72);
}

.cover-page .thread-link:nth-child(1) {
  --thread-width: 64px;
}

.cover-page .thread-link:nth-child(2) {
  --thread-width: 62px;
}

.cover-page .thread-link:nth-child(3) {
  --thread-width: 70px;
}

.cover-page .thread-link:nth-child(4) {
  --thread-width: 68px;
}

.cover-page .thread-link:nth-child(5) {
  --thread-width: 64px;
}

.cover-page .thread-link:nth-child(6) {
  --thread-width: 74px;
}

.cover-page .thread-link:nth-child(7) {
  --thread-width: 66px;
}

.cover-page .thread-link:nth-child(8) {
  --thread-width: 76px;
}

.thread-link:hover img,
.thread-link:focus-visible img {
  filter:
    drop-shadow(0 0 2px rgba(255, 246, 207, .92))
    drop-shadow(0 0 7px var(--thread-glow))
    drop-shadow(0 3px 2px rgba(37, 25, 16, .2))
    saturate(1.14)
    contrast(1.05)
    brightness(1.08);
  transform: translateX(-50%) translateY(-2px) rotate(var(--thread-tilt, 0deg)) scale(1.025);
}

.thread-link[aria-current="page"] img {
  filter:
    drop-shadow(0 0 3px rgba(166, 124, 51, .5))
    drop-shadow(0 3px 2px rgba(37, 25, 16, .2))
    saturate(1.06)
    contrast(1.03)
    brightness(1.03);
}

.thread-link:focus-visible::after {
  content: "";
  position: absolute;
  top: .2rem;
  right: 2px;
  left: 2px;
  height: 2.25rem;
  border: 1px dotted rgba(44, 41, 37, .72);
}

.thread-link:hover,
.thread-link:focus-visible {
  z-index: 30;
}

.thread-label {
  position: fixed;
  top: clamp(8rem, 36vh, 20rem);
  right: calc(3.15rem + clamp(240px, 21vw, 280px));
  width: max-content;
  max-width: 210px;
  padding: 7px 12px 8px;
  border: 1px solid rgba(72, 52, 30, .3);
  background:
    linear-gradient(94deg, rgba(92, 57, 24, .05), transparent 22%, rgba(255, 250, 230, .22) 78%, rgba(92, 57, 24, .06)),
    rgba(229, 222, 204, .97);
  box-shadow:
    0 3px 9px rgba(47, 36, 25, .16),
    inset 0 0 0 1px rgba(255, 252, 235, .3);
  color: #372d23;
  font-family: Georgia, "Times New Roman", serif;
  font-size: .74rem;
  font-variant: small-caps;
  letter-spacing: .1em;
  line-height: 1.15;
  opacity: 0;
  pointer-events: none;
  transform: translate(5px, -50%) rotate(-.7deg);
  transform-origin: 100% 50%;
  transition: opacity .16s ease, transform .16s ease;
}

.cover-page .thread-label {
  right: calc(clamp(4rem, 6.3vw, 5rem) + clamp(280px, 23.5vw, 310px) + 2rem);
}

.thread-label::after {
  content: "";
  position: absolute;
  top: 50%;
  right: -11px;
  width: 11px;
  border-top: 1px solid rgba(77, 54, 31, .42);
}

.thread-link:hover .thread-label,
.thread-link:focus-visible .thread-label {
  opacity: 1;
  transform: translate(0, -50%) rotate(-.7deg);
}

.thread-mobile {
  display: none;
}

.subpage-stage {
  position: absolute;
  inset:
    clamp(4.4rem, 7.5vh, 6.5rem)
    clamp(300px, 26vw, 500px)
    1.8rem
    clamp(90px, 8vw, 155px);
  z-index: 1;
  overflow-x: hidden;
  overflow-y: auto;
  scrollbar-color: rgba(83, 65, 42, .35) transparent;
  scrollbar-width: thin;
}

.archive-shell {
  width: min(920px, calc(100% - 1.4rem));
  margin: 0 auto 2rem;
  padding: clamp(1.2rem, 2.7vw, 2.3rem);
  border: 1px solid rgba(75, 61, 43, .2);
  background:
    linear-gradient(90deg, rgba(115, 83, 43, .035), transparent 17%, transparent 83%, rgba(115, 83, 43, .03)),
    rgba(224, 221, 213, .58);
  box-shadow: 0 12px 36px rgba(44, 37, 29, .08);
}

.archive-shell.is-private {
  border-color: rgba(117, 27, 21, .34);
  background:
    linear-gradient(90deg, rgba(105, 18, 16, .045), transparent 20%, transparent 80%, rgba(105, 18, 16, .04)),
    rgba(222, 216, 207, .76);
}

.archive-header {
  position: relative;
  padding: 0 0 1.3rem;
  border-bottom: 1px solid rgba(90, 66, 35, .2);
}

.archive-eyebrow {
  margin: 0 0 .5rem;
  color: rgba(25, 22, 19, .56);
  font-size: .62rem;
  letter-spacing: .22em;
  text-transform: uppercase;
}

.archive-header h1 {
  margin: 0;
  max-width: 80%;
  font-size: clamp(1.65rem, 3vw, 2.8rem);
  font-weight: 400;
  letter-spacing: .035em;
}

.archive-intro {
  max-width: 62ch;
  margin: .75rem 0 0;
  color: rgba(30, 26, 22, .68);
  font-size: .9rem;
  line-height: 1.55;
}

.archive-private-seal {
  position: absolute;
  top: .2rem;
  right: .2rem;
  padding: .55rem .42rem;
  border: 1px solid rgba(126, 31, 25, .55);
  color: rgba(109, 23, 18, .78);
  font-size: .57rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  transform: rotate(-3deg);
}

.archive-return {
  margin: 1rem 0 0;
  padding: .45rem .65rem;
  border: 1px solid rgba(82, 63, 40, .26);
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-size: .72rem;
  letter-spacing: .05em;
}

.archive-figure {
  float: right;
  width: clamp(145px, 23vw, 230px);
  margin: 1.35rem 0 1rem 1.8rem;
  padding: .35rem;
  border: 1px solid rgba(103, 75, 37, .3);
  background: rgba(198, 187, 165, .35);
  box-shadow: 0 5px 15px rgba(45, 35, 25, .12);
}

.archive-figure img {
  display: block;
  width: 100%;
  max-height: 310px;
  object-fit: cover;
  filter: saturate(.78) contrast(.96);
}

.archive-sheet {
  min-width: 0;
  padding-top: 1.2rem;
}

.archive-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem 1rem;
  margin: 0 0 1.35rem;
  padding-bottom: .8rem;
  border-bottom: 1px solid rgba(91, 68, 39, .16);
}

.archive-tab {
  position: relative;
  padding: .35rem .05rem;
  border: 0;
  background: transparent;
  color: rgba(30, 26, 22, .62);
  cursor: pointer;
  font: inherit;
  font-size: .76rem;
  letter-spacing: .075em;
}

.archive-tab[aria-selected="true"] {
  color: var(--ink);
}

.archive-tab[aria-selected="true"]::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -.84rem;
  left: 0;
  height: 2px;
  background: #8a2b25;
}

.archive-tab:focus-visible,
.archive-return:focus-visible {
  outline: 1px dotted var(--ink);
  outline-offset: 3px;
}

.archive-panel {
  min-width: 0;
}

.archive-entry {
  margin: 0 0 1.35rem;
}

.archive-entry h2,
.archive-block-heading {
  margin: 0 0 .5rem;
  color: #3f3225;
  font-size: 1.06rem;
  font-weight: 400;
  letter-spacing: .025em;
}

.archive-entry p {
  max-width: 76ch;
  margin: 0 0 .55rem;
  font-size: .87rem;
  line-height: 1.62;
}

.archive-entry + .archive-entry {
  padding-top: 1rem;
  border-top: 1px solid rgba(91, 68, 39, .12);
}

.archive-list-line {
  position: relative;
  padding-left: 1rem;
}

.archive-list-line::before {
  content: "—";
  position: absolute;
  left: 0;
  color: rgba(118, 38, 30, .72);
}

.archive-table-wrap {
  max-width: 100%;
  margin: 0 0 1.6rem;
  overflow-x: auto;
}

.archive-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .82rem;
  line-height: 1.45;
}

.archive-table caption {
  padding: 0 0 .75rem;
  color: #3f3225;
  font-size: 1.05rem;
  text-align: left;
}

.archive-table th,
.archive-table td {
  padding: .55rem .6rem;
  border-bottom: 1px solid rgba(83, 63, 39, .14);
  vertical-align: top;
  text-align: left;
}

.archive-table th {
  width: 29%;
  color: rgba(35, 29, 23, .68);
  font-weight: 400;
  letter-spacing: .025em;
}

.archive-accordion {
  display: grid;
  gap: .55rem;
}

.archive-person {
  border-bottom: 1px solid rgba(82, 61, 36, .16);
}

.archive-person summary {
  min-height: 44px;
  padding: .75rem .2rem;
  cursor: pointer;
  color: #3f3225;
  font-size: .9rem;
  letter-spacing: .035em;
}

.archive-person-body {
  padding: .3rem .2rem 1rem 1rem;
  border-left: 1px solid rgba(133, 42, 32, .25);
}

.archive-empty {
  display: grid;
  min-height: 250px;
  place-items: center;
  align-content: center;
  gap: .8rem;
  color: rgba(38, 32, 26, .62);
  text-align: center;
}

.archive-empty-mark {
  color: rgba(126, 39, 30, .32);
  font-size: 2.8rem;
}

.archive-empty p {
  max-width: 45ch;
  margin: 0;
  font-size: .86rem;
  line-height: 1.55;
}

.archive-load-error {
  display: grid;
  min-height: 70vh;
  place-items: center;
  align-content: center;
  text-align: center;
}

.archive-load-error h1 {
  font-size: 1.3rem;
  font-weight: 400;
}

.archive-dialog {
  width: min(430px, calc(100vw - 2rem));
  padding: 0;
  border: 1px solid rgba(90, 61, 34, .38);
  background: #d9d5cb;
  color: var(--ink);
  box-shadow: 0 18px 60px rgba(0, 0, 0, .32);
}

.archive-dialog::backdrop {
  background: rgba(18, 15, 12, .55);
  backdrop-filter: blur(2px);
}

.archive-dialog form {
  padding: 1.55rem;
}

.archive-dialog-kicker {
  margin: 0 0 .45rem;
  color: rgba(111, 29, 23, .72);
  font-size: .58rem;
  letter-spacing: .17em;
  text-transform: uppercase;
}

.archive-dialog h2 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 400;
}

.archive-dialog-copy {
  margin: .7rem 0 1.15rem;
  font-size: .84rem;
  line-height: 1.5;
}

.cryptex {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 30px;
  align-items: stretch;
  min-height: 78px;
  margin: 1.35rem 0 .3rem;
  filter: drop-shadow(0 8px 8px rgba(42, 28, 17, .22));
}

.cryptex-cap {
  position: relative;
  z-index: 2;
  border: 1px solid #755b37;
  background:
    linear-gradient(90deg, #5c4326, #a8844d 43%, #d1b272 55%, #71532e);
  box-shadow:
    inset 0 1px 0 rgba(255, 242, 191, .45),
    inset 0 -2px 4px rgba(44, 28, 13, .5);
}

.cryptex-cap-left {
  border-radius: 9px 2px 2px 9px;
}

.cryptex-cap-right {
  border-radius: 2px 9px 9px 2px;
}

.cryptex-cap::before,
.cryptex-cap::after {
  content: "";
  position: absolute;
  right: 4px;
  left: 4px;
  height: 1px;
  background: rgba(48, 29, 12, .55);
}

.cryptex-cap::before {
  top: 18px;
}

.cryptex-cap::after {
  bottom: 18px;
}

.cryptex-wheels {
  position: relative;
  display: grid;
  grid-template-columns: repeat(7, minmax(29px, 1fr));
  overflow: hidden;
  border-top: 1px solid #6d522f;
  border-bottom: 1px solid #5a4022;
  background: #6a4d2b;
}

.cryptex-wheels::before,
.cryptex-wheels::after {
  content: "";
  position: absolute;
  right: 0;
  left: 0;
  z-index: 2;
  height: 22px;
  pointer-events: none;
}

.cryptex-wheels::before {
  top: 0;
  background: linear-gradient(rgba(44, 27, 12, .56), transparent);
}

.cryptex-wheels::after {
  bottom: 0;
  background: linear-gradient(transparent, rgba(44, 27, 12, .62));
}

.cryptex-wheel {
  position: relative;
  z-index: 1;
  min-width: 0;
  height: 76px;
  padding: 0;
  border: 0;
  border-right: 1px solid rgba(65, 43, 20, .72);
  border-left: 1px solid rgba(224, 193, 125, .3);
  border-radius: 0;
  appearance: none;
  background:
    repeating-linear-gradient(0deg, transparent 0 8px, rgba(55, 35, 17, .22) 8px 9px),
    linear-gradient(90deg, #7a5b32, #c29c5e 45%, #8a683c);
  color: #21180e;
  cursor: ns-resize;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1rem, 3vw, 1.35rem);
  font-weight: 700;
  text-align: center;
  text-align-last: center;
  text-shadow: 0 1px rgba(246, 220, 159, .45);
}

.cryptex-wheel:last-child {
  border-right: 0;
}

.cryptex-wheel:focus-visible {
  z-index: 4;
  outline: 2px solid #76251f;
  outline-offset: -4px;
}

.cryptex.is-denied {
  animation: cryptex-denied .34s ease;
}

@keyframes cryptex-denied {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

.archive-dialog-status {
  min-height: 1.2rem;
  margin: .55rem 0 0;
  color: #7b211b;
  font-size: .76rem;
}

.archive-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: .6rem;
  margin-top: .7rem;
}

.archive-dialog-actions button {
  min-height: 42px;
  padding: .6rem .85rem;
  border: 1px solid rgba(72, 55, 35, .32);
  border-radius: 0;
  cursor: pointer;
  font: inherit;
  font-size: .76rem;
}

.archive-dialog-cancel {
  background: transparent;
  color: inherit;
}

.archive-dialog-submit {
  background: #4b3526;
  color: #eee9df;
}

@media (prefers-reduced-motion: reduce) {
  .native-name,
  .kanji-name,
  .hanko,
  .thread-strand img,
  .thread-label {
    transition: none;
  }
}

@media (min-width: 1500px) and (min-height: 760px) {
  .cover-page .portrait {
    top: 26vh;
    left: 8vw;
    width: clamp(380px, 22vw, 440px);
  }

  .cover-page .motif-column {
    top: 15vh;
    left: 34vw;
    width: clamp(470px, 28vw, 550px);
  }

  .cover-jasmine {
    top: 5vh;
    left: 22vw;
    width: clamp(340px, 20vw, 400px);
  }

  .cover-feather {
    left: -2vw;
    bottom: 4vh;
    width: clamp(580px, 38vw, 730px);
  }

  .cover-coins {
    left: 52vw;
    bottom: 13vh;
    width: clamp(198px, 11vw, 220px);
  }
}

@media (max-width: 1120px) {
  .stage-layout {
    right: 2.4rem;
  }

  .cover-page .stage-layout {
    right: 2.4rem;
  }

  .cover-page .portrait {
    left: 3.8rem;
    width: 270px;
  }

  .cover-page .motif-column {
    left: 20rem;
    width: min(48vw, 500px);
  }

  .cover-jasmine {
    right: 2.8rem;
    left: auto;
    width: 210px;
  }

  .cover-coins {
    left: auto;
    right: 3rem;
  }

  .thread-band {
    display: none;
  }

  .thread-mobile {
    position: fixed;
    right: 1.6rem;
    bottom: 1.6rem;
    z-index: 6;
    display: block;
    width: min(430px, calc(100vw - 3.2rem - (2 * var(--outer))));
    background: rgba(220, 217, 209, .96);
    border-top: 1px solid rgba(74, 53, 29, .22);
  }

  .thread-mobile summary {
    min-height: 44px;
    padding: .85rem .4rem .7rem;
    cursor: pointer;
    font-size: .72rem;
    letter-spacing: .14em;
    text-transform: uppercase;
  }

  .thread-mobile ul {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    margin: 0;
    padding: 0 0 .55rem;
    list-style: none;
  }

  .thread-mobile a {
    display: flex;
    min-height: 44px;
    align-items: center;
    gap: .55rem;
    padding: .45rem .4rem;
    color: inherit;
    font-size: .84rem;
    text-decoration: none;
  }

  .thread-mobile a:focus-visible {
    outline: 1px dotted var(--ink);
    outline-offset: -3px;
  }

  .thread-mobile a[aria-current="page"] {
    text-decoration: underline;
    text-decoration-color: var(--gold);
    text-underline-offset: .24em;
  }

  .thread-mobile i {
    width: 21px;
    height: 2px;
    flex: 0 0 auto;
    background: var(--thread-color);
    box-shadow: 0 1px 1px rgba(44, 41, 37, .2);
  }

  .subpage-stage {
    right: 2.4rem;
  }
}

@media (max-width: 760px) {
  body {
    overflow: auto;
  }

  body:not(.cover-page) {
    background-attachment: scroll;
  }

  body.cover-page {
    background-attachment: scroll;
  }

  .landing {
    min-height: 100dvh;
  }

  .cover-page .landing {
    min-height: 1100px;
  }

  .landing::before {
    inset: .72rem;
  }

  .archive-note {
    top: 1.45rem;
    left: 1.55rem;
    max-width: calc(100% - 3.1rem);
  }

  .stage-layout {
    position: relative;
    inset: auto;
    min-height: 100dvh;
    padding: 4.4rem 1.2rem 8.6rem;
    grid-template-columns: 1fr;
    align-content: center;
    justify-items: center;
    gap: .6rem;
  }

  .cover-page .stage-layout {
    position: relative;
    inset: auto;
    min-height: 1100px;
    padding: 0;
    display: block;
  }

  .portrait {
    width: clamp(168px, 54vw, 232px);
    transform: translateX(calc(.55rem - 55%));
  }

  .cover-page .portrait {
    top: 4.6rem;
    left: 1rem;
    width: clamp(138px, 42vw, 158px);
    margin: 0;
    transform:
      perspective(760px)
      rotateX(1deg)
      rotateY(-2.2deg)
      rotateZ(-2deg);
  }

  .motif-column {
    width: 100%;
  }

  .cover-page .motif-column {
    position: absolute;
    top: 22rem;
    right: 1rem;
    left: 1rem;
    width: auto;
  }

  .motif {
    width: 100%;
    max-width: 650px;
  }

  .thread-hint {
    margin-top: clamp(4rem, 13vw, 5rem);
    font-size: .82rem;
  }

  .cover-page .thread-hint {
    top: calc(100% + 4.2rem);
    left: 8%;
    width: 48%;
    margin: 0;
  }

  .cover-jasmine {
    top: 5rem;
    right: .4rem;
    left: auto;
    width: clamp(112px, 34vw, 132px);
  }

  .cover-feather {
    right: auto;
    top: 9rem;
    bottom: auto;
    left: -3.5rem;
    width: 300px;
  }

  .cover-coins {
    top: 42rem;
    right: 2rem;
    bottom: auto;
    left: auto;
    width: 112px;
  }

  .thread-mobile {
    position: fixed;
    right: 1.15rem;
    bottom: 1.15rem;
    width: calc(100% - 2.3rem);
  }

  .thread-mobile ul {
    grid-template-columns: 1fr;
    max-height: 44vh;
    overflow-y: auto;
  }

  .subpage-stage {
    position: relative;
    inset: auto;
    min-height: 100dvh;
    padding: 4.2rem 1rem 8rem;
    overflow: visible;
  }

  .archive-shell {
    width: 100%;
    margin-bottom: 0;
    padding: 1.05rem;
  }

  .archive-header h1 {
    max-width: none;
    padding-right: 0;
    font-size: 1.55rem;
  }

  .archive-private-seal {
    position: static;
    display: inline-block;
    margin-top: .85rem;
  }

  .archive-figure {
    float: none;
    width: min(240px, 72vw);
    margin: 1rem auto;
  }

  .archive-tab[aria-selected="true"]::after {
    bottom: -.12rem;
  }

  .archive-tabs {
    gap: .25rem .8rem;
    padding-bottom: .2rem;
  }

  .archive-table {
    min-width: 480px;
  }

  .archive-person-body {
    padding-left: .65rem;
  }
}

/* Cover composition v7: one key image, one interactive thread plane, one emblem video. */
body.cover-page {
  overflow: hidden;
  background: #18110c;
}

.cover-page .landing {
  min-height: 100dvh;
  background: #18110c;
}

.cover-page .landing::before,
.cover-page .landing::after {
  display: none;
}

.cover-page .key-art {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 50%;
  pointer-events: none;
  user-select: none;
}

.cover-page .archive-note {
  top: 3.65%;
  left: 3.4%;
  z-index: 4;
  color: rgba(42, 27, 16, .67);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(.48rem, .52vw, .65rem);
  letter-spacing: .16em;
  text-shadow: 0 1px rgba(255, 246, 221, .35);
}

.cover-page .emblem-layer {
  position: absolute;
  top: -1.2%;
  left: 38%;
  z-index: 2;
  width: 33.5%;
  aspect-ratio: 1;
  pointer-events: none;
}

.cover-page .emblem-video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 5px 5px rgba(59, 39, 19, .08));
}

.cover-page .thread-band {
  top: 6.1%;
  right: 7.2%;
  bottom: 4.6%;
  z-index: 3;
  width: 23.3%;
  padding: 0;
  align-items: stretch;
}

.cover-page .thread-band::before {
  display: none;
}

.cover-page .thread-strand img {
  filter:
    drop-shadow(5px 10px 5px rgba(33, 20, 11, .34))
    drop-shadow(0 2px 1px rgba(48, 29, 14, .24))
    saturate(1.04)
    contrast(1.035);
}

.cover-page .thread-link:nth-child(1) {
  --thread-top: .2%;
  --thread-bottom: 8.5%;
  --thread-width: clamp(54px, 4.2vw, 76px);
  --thread-tilt: -.8deg;
}

.cover-page .thread-link:nth-child(2) {
  --thread-top: 1.1%;
  --thread-bottom: 4.5%;
  --thread-width: clamp(52px, 4vw, 73px);
  --thread-tilt: .65deg;
}

.cover-page .thread-link:nth-child(3) {
  --thread-top: .45%;
  --thread-bottom: 7%;
  --thread-width: clamp(58px, 4.55vw, 82px);
  --thread-tilt: -.35deg;
}

.cover-page .thread-link:nth-child(4) {
  --thread-top: 1.5%;
  --thread-bottom: 1.2%;
  --thread-width: clamp(58px, 4.5vw, 81px);
  --thread-tilt: .7deg;
}

.cover-page .thread-link:nth-child(5) {
  --thread-top: 2.3%;
  --thread-bottom: 9.8%;
  --thread-width: clamp(53px, 4.05vw, 73px);
  --thread-tilt: -1deg;
}

.cover-page .thread-link:nth-child(6) {
  --thread-top: .7%;
  --thread-bottom: 3.2%;
  --thread-width: clamp(61px, 4.8vw, 87px);
  --thread-tilt: .35deg;
}

.cover-page .thread-link:nth-child(7) {
  --thread-top: 1.8%;
  --thread-bottom: .2%;
  --thread-width: clamp(55px, 4.2vw, 76px);
  --thread-tilt: -.6deg;
}

.cover-page .thread-link:nth-child(8) {
  --thread-top: .9%;
  --thread-bottom: 5.6%;
  --thread-width: clamp(63px, 4.95vw, 89px);
  --thread-tilt: .9deg;
}

.cover-page .thread-label {
  top: 46%;
  right: calc(7.2% + 23.3% + 1.1rem);
  border-color: rgba(83, 54, 25, .34);
  background:
    linear-gradient(100deg, rgba(102, 63, 25, .06), transparent 22%, rgba(255, 247, 218, .2)),
    rgba(226, 205, 163, .97);
  box-shadow:
    0 5px 14px rgba(43, 26, 12, .23),
    inset 0 0 0 1px rgba(255, 247, 221, .28);
}

@media (min-width: 1121px) and (min-aspect-ratio: 2 / 1) {
  .cover-page .emblem-layer {
    top: -4.5%;
    left: 38.5%;
    width: 30.5%;
  }
}

@media (max-width: 1120px) {
  .cover-page .thread-band {
    display: none;
  }

  .cover-page .emblem-layer {
    top: 1%;
    left: 37%;
    width: 41%;
  }

  .cover-page .thread-mobile {
    border: 1px solid rgba(76, 49, 24, .38);
    background:
      linear-gradient(rgba(255, 246, 219, .16), rgba(78, 47, 20, .05)),
      rgba(226, 205, 163, .97);
    box-shadow: 0 8px 28px rgba(32, 20, 11, .3);
  }
}

@media (max-width: 760px) {
  body.cover-page {
    overflow: hidden;
  }

  .cover-page .landing {
    min-height: 100dvh;
  }

  .cover-page .key-art {
    object-position: 52% 50%;
  }

  .cover-page .archive-note {
    display: none;
  }

  .cover-page .emblem-layer {
    top: 2%;
    left: 18%;
    width: 64%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cover-page .thread-strand img,
  .cover-page .thread-label {
    transition: none;
  }
}

/* Cover composition v8: editor-approved independent layers. */
.cover-page .emblem-layer {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  width: max(100vw, 160dvh);
  height: max(100dvh, 62.5vw);
  aspect-ratio: 8 / 5;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.cover-page .cover-piece {
  position: absolute;
  left: var(--piece-x);
  top: var(--piece-y);
  z-index: var(--piece-z);
  display: block;
  width: var(--piece-width);
  height: auto;
  max-width: none;
  opacity: var(--piece-opacity);
  transform:
    translate(-50%, -50%)
    rotate(var(--piece-rotation));
  transform-origin: center;
  object-fit: contain;
  user-select: none;
}

.cover-page .cover-symbol {
  --piece-x: 53.5%;
  --piece-y: 34.7%;
  --piece-width: 34%;
  --piece-rotation: 0deg;
  --piece-opacity: 1;
  --piece-z: 2;
  aspect-ratio: 16 / 9;
  filter: drop-shadow(0 5px 5px rgba(59, 39, 19, .08));
}

.cover-page .cover-wordmark {
  --piece-x: 52.8%;
  --piece-y: 51.5%;
  --piece-width: 22%;
  --piece-rotation: 0deg;
  --piece-opacity: 1;
  --piece-z: 4;
}

.cover-page .cover-kanji {
  --piece-x: 64.5%;
  --piece-y: 31.5%;
  --piece-width: 6.1%;
  --piece-rotation: 0deg;
  --piece-opacity: .6;
  --piece-z: 10;
}

.cover-page .cover-hanko {
  --piece-x: 63.9%;
  --piece-y: 48.3%;
  --piece-width: 5.7%;
  --piece-rotation: 17.4deg;
  --piece-opacity: .5;
  --piece-z: 1;
}

.cover-page .thread-band {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: block;
  width: auto;
  padding: 0;
  overflow: visible;
  pointer-events: none;
}

.cover-page .thread-strand {
  position: absolute;
  left: var(--thread-x);
  top: var(--thread-y);
  z-index: var(--thread-z);
  display: block;
  width: var(--thread-width-pct);
  height: var(--thread-height);
  min-width: 0;
  pointer-events: auto;
  transform:
    translate(-50%, -50%)
    rotate(var(--thread-rotation));
  transform-origin: center;
}

.cover-page .thread-strand img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
  transform: none;
  transform-origin: center;
}

.cover-page .thread-link:nth-child(1) {
  --thread-x: 74.2%;
  --thread-y: 39.2%;
  --thread-width-pct: 4.2%;
  --thread-height: 85.3%;
  --thread-rotation: -.8deg;
  --thread-z: 1;
}

.cover-page .thread-link:nth-child(2) {
  --thread-x: 76.8%;
  --thread-y: 37.3%;
  --thread-width-pct: 4%;
  --thread-height: 88.3%;
  --thread-rotation: .65deg;
  --thread-z: 2;
}

.cover-page .thread-link:nth-child(3) {
  --thread-x: 80.1%;
  --thread-y: 41.8%;
  --thread-width-pct: 4.55%;
  --thread-height: 86.5%;
  --thread-rotation: -.35deg;
  --thread-z: 2;
}

.cover-page .thread-link:nth-child(4) {
  --thread-x: 82%;
  --thread-y: 41.8%;
  --thread-width-pct: 4.5%;
  --thread-height: 91.2%;
  --thread-rotation: .7deg;
  --thread-z: 1;
}

.cover-page .thread-link:nth-child(5) {
  --thread-x: 85.2%;
  --thread-y: 36.6%;
  --thread-width-pct: 4.05%;
  --thread-height: 81.8%;
  --thread-rotation: -1deg;
  --thread-z: 2;
}

.cover-page .thread-link:nth-child(6) {
  --thread-x: 87.2%;
  --thread-y: 40.5%;
  --thread-width-pct: 4.8%;
  --thread-height: 89.2%;
  --thread-rotation: .35deg;
  --thread-z: 1;
}

.cover-page .thread-link:nth-child(7) {
  --thread-x: 89.8%;
  --thread-y: 41.8%;
  --thread-width-pct: 4.2%;
  --thread-height: 91.6%;
  --thread-rotation: -.6deg;
  --thread-z: 2;
}

.cover-page .thread-link:nth-child(8) {
  --thread-x: 91.7%;
  --thread-y: 39.2%;
  --thread-width-pct: 4.95%;
  --thread-height: 87.2%;
  --thread-rotation: .9deg;
  --thread-z: 1;
}

.cover-page .thread-link:hover img,
.cover-page .thread-link:focus-visible img {
  transform: translateY(-2px) scale(1.025);
}

.cover-page .thread-link:hover,
.cover-page .thread-link:focus-visible {
  z-index: 30;
}

.cover-page .thread-label {
  position: absolute;
  top: 50%;
  right: calc(100% + 1rem);
  transform: translate(5px, -50%) rotate(.7deg);
}

.cover-page .thread-link:hover .thread-label,
.cover-page .thread-link:focus-visible .thread-label {
  transform: translate(0, -50%) rotate(.7deg);
}

/* Keep the desktop subpage navigation on the same thread plane as the cover. */
body:not(.cover-page) .thread-band {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: block;
  width: auto;
  padding: 0;
  overflow: visible;
  pointer-events: none;
}

body:not(.cover-page) .thread-band::before {
  display: none;
}

body:not(.cover-page) .thread-strand {
  position: absolute;
  left: var(--thread-x);
  top: var(--thread-y);
  z-index: var(--thread-z);
  display: block;
  width: var(--thread-width-pct);
  height: var(--thread-height);
  min-width: 0;
  pointer-events: auto;
  transform:
    translate(-50%, -50%)
    rotate(var(--thread-rotation));
  transform-origin: center;
}

body:not(.cover-page) .thread-strand img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
  transform: none;
  transform-origin: center;
}

body:not(.cover-page) .thread-link:nth-child(1) {
  --thread-x: 73.4%;
  --thread-y: 39.2%;
  --thread-width-pct: 4.2%;
  --thread-height: 85.3%;
  --thread-rotation: -.8deg;
  --thread-z: 1;
}

body:not(.cover-page) .thread-link:nth-child(2) {
  --thread-x: 76.6%;
  --thread-y: 37.3%;
  --thread-width-pct: 4%;
  --thread-height: 88.3%;
  --thread-rotation: .65deg;
  --thread-z: 2;
}

body:not(.cover-page) .thread-link:nth-child(3) {
  --thread-x: 80.1%;
  --thread-y: 41.8%;
  --thread-width-pct: 4.55%;
  --thread-height: 86.5%;
  --thread-rotation: -.35deg;
  --thread-z: 2;
}

body:not(.cover-page) .thread-link:nth-child(4) {
  --thread-x: 82.5%;
  --thread-y: 41.8%;
  --thread-width-pct: 4.5%;
  --thread-height: 91.2%;
  --thread-rotation: .7deg;
  --thread-z: 1;
}

body:not(.cover-page) .thread-link:nth-child(5) {
  --thread-x: 85.9%;
  --thread-y: 36.6%;
  --thread-width-pct: 4.05%;
  --thread-height: 81.8%;
  --thread-rotation: -1deg;
  --thread-z: 2;
}

body:not(.cover-page) .thread-link:nth-child(6) {
  --thread-x: 87.9%;
  --thread-y: 40.5%;
  --thread-width-pct: 4.8%;
  --thread-height: 89.2%;
  --thread-rotation: .35deg;
  --thread-z: 1;
}

body:not(.cover-page) .thread-link:nth-child(7) {
  --thread-x: 90.5%;
  --thread-y: 41.8%;
  --thread-width-pct: 4.2%;
  --thread-height: 91.6%;
  --thread-rotation: -.6deg;
  --thread-z: 2;
}

body:not(.cover-page) .thread-link:nth-child(8) {
  --thread-x: 92.4%;
  --thread-y: 39.2%;
  --thread-width-pct: 4.95%;
  --thread-height: 87.2%;
  --thread-rotation: .9deg;
  --thread-z: 1;
}

body:not(.cover-page) .thread-link:hover img,
body:not(.cover-page) .thread-link:focus-visible img {
  transform: translateY(-2px) scale(1.025);
}

body:not(.cover-page) .thread-label {
  position: absolute;
  top: 50%;
  right: calc(100% + 1rem);
  transform: translate(5px, -50%) rotate(.7deg);
}

body:not(.cover-page) .thread-link:hover .thread-label,
body:not(.cover-page) .thread-link:focus-visible .thread-label {
  transform: translate(0, -50%) rotate(.7deg);
}

@media (max-width: 1120px) {
  .cover-page .thread-band {
    display: none;
  }

  body:not(.cover-page) .thread-band {
    display: none;
  }

  .cover-page .cover-symbol {
    --piece-x: 53%;
    --piece-y: 29%;
    --piece-width: 41%;
  }

  .cover-page .cover-wordmark {
    --piece-x: 49%;
    --piece-y: 48%;
    --piece-width: 26.5%;
  }

  .cover-page .cover-kanji {
    --piece-x: 67%;
    --piece-y: 27%;
    --piece-width: 7.3%;
  }

  .cover-page .cover-hanko {
    --piece-x: 66.3%;
    --piece-y: 46%;
    --piece-width: 6.9%;
  }
}

/* Book navigation transitions (2026-08). Geometry is tied to the 1672 × 941 art. */
[hidden] {
  display: none !important;
}

.archive-navigation-status {
  position: fixed;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.no-script-notice {
  max-width: 44rem;
  margin: 3rem auto;
  padding: 1.4rem;
  border: 1px solid rgba(75, 61, 43, .24);
  background: rgba(224, 221, 213, .76);
  line-height: 1.55;
}

.no-script-notice h1 {
  margin: 0 0 .7rem;
  font-size: 1.4rem;
  font-weight: 400;
}

.no-script-notice a {
  color: inherit;
  text-underline-offset: .2em;
}

.book-open-underlay {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    #4a2e1c
    url("subpages/akai-open-book-background-v3.png")
    center / cover no-repeat;
}

body.is-cover-transitioning .key-art {
  z-index: 1;
  will-change: opacity;
}

body.is-cover-transitioning .subpage-stage {
  z-index: 2;
  opacity: 0;
  contain: layout paint style;
}

body.is-cover-transitioning .archive-note,
body.is-cover-transitioning .emblem-layer {
  z-index: 4;
  will-change: opacity;
}

body.is-cover-transitioning .thread-band,
body.is-cover-transitioning .thread-mobile {
  z-index: 8;
  will-change: transform, opacity;
}

.book-spine-overlay,
.book-transition-scene {
  --book-plane-width: max(100vw, calc(100dvh * 1.776833));
  --book-plane-height: max(100dvh, calc(100vw / 1.776833));
}

.book-spine-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 5;
  width: var(--book-plane-width);
  height: var(--book-plane-height);
  pointer-events: none;
  background:
    url("cover/akai-cover-spine-overlay-v1.png")
    right center / 7.117225% 100% no-repeat;
  transform: translate(-50%, -50%);
  will-change: opacity;
}

.book-transition-scene {
  position: absolute;
  inset: 0;
  z-index: 6;
  overflow: hidden;
  pointer-events: none;
  perspective: clamp(1200px, 135vw, 2600px);
  perspective-origin: 68% 48%;
  transform-style: preserve-3d;
}

.book-cover-flap,
.book-hinge-shadow {
  position: absolute;
  top: 50%;
  left: 50%;
  width: var(--book-plane-width);
  height: var(--book-plane-height);
  transform: translate(-50%, -50%);
}

.book-cover-flap {
  z-index: 2;
  background:
    url("cover/akai-key-art-v1.png")
    center / 100% 100% no-repeat;
  -webkit-mask-image: url("cover/akai-cover-flap-mask-v1.png");
  mask-image: url("cover/akai-cover-flap-mask-v1.png");
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: 100% 100%;
  mask-size: 100% 100%;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  transform-origin: 92.64% 50%;
  transform-style: preserve-3d;
  backface-visibility: hidden;
  filter: drop-shadow(12px 4px 10px rgba(31, 18, 9, .28));
  will-change: transform, opacity;
}

.book-hinge-shadow {
  z-index: 1;
  opacity: 0;
  pointer-events: none;
  background:
    linear-gradient(
      90deg,
      transparent 90.9%,
      rgba(24, 13, 7, .08) 91.8%,
      rgba(20, 11, 6, .5) 92.65%,
      rgba(51, 29, 14, .16) 93.15%,
      transparent 94.1%
    );
  will-change: opacity, transform;
}

body.is-page-turning .subpage-stage {
  overflow: hidden;
}

body.is-page-turning .archive-shell {
  will-change: transform, opacity;
}

body.is-page-turning .thread-band,
body.is-page-turning .thread-mobile {
  z-index: 8;
  pointer-events: none;
  will-change: transform, opacity;
}

.page-turn-layer {
  position: absolute;
  z-index: 2;
  pointer-events: none;
  perspective: 1600px;
  perspective-origin: 88% 48%;
  transform-style: preserve-3d;
}

.page-turn-leaf {
  position: absolute;
  inset: 0;
  transform-origin: 100% 50%;
  transform-style: preserve-3d;
  will-change: transform;
}

.page-turn-face {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border: 1px solid rgba(91, 68, 39, .14);
  border-radius: 3px 10px 12px 3px;
  backface-visibility: hidden;
  background:
    linear-gradient(90deg, rgba(255, 253, 245, .16), transparent 9%, rgba(67, 44, 22, .06) 100%),
    rgba(218, 211, 195, .96);
  box-shadow: 0 8px 18px rgba(39, 25, 13, .13);
}

.page-turn-face--front {
  transform: translateZ(.2px);
}

.page-turn-face--back {
  transform: rotateY(180deg) translateZ(.2px);
  background:
    radial-gradient(ellipse at 24% 32%, rgba(255, 250, 231, .26), transparent 42%),
    linear-gradient(270deg, rgba(255, 253, 245, .18), transparent 12%, rgba(67, 44, 22, .07) 100%),
    rgb(225, 216, 197);
}

.page-turn-copy {
  width: 100%;
  min-height: 100%;
  transform-origin: top left;
}

.page-turn-copy .archive-shell {
  min-height: 100%;
  pointer-events: none;
  user-select: none;
}

.page-turn-edge-shadow {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 3;
  width: 4px;
  opacity: 0;
  background: linear-gradient(90deg, rgba(52, 32, 15, .55), rgba(255, 246, 224, .24), transparent);
  box-shadow: -5px 0 11px rgba(35, 21, 10, .24);
  transform: translateZ(1px);
  will-change: opacity;
}

.page-turn-gutter-shadow {
  position: absolute;
  top: 1.5%;
  right: -8px;
  bottom: 1.5%;
  z-index: 0;
  width: 26px;
  opacity: 0;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(34, 18, 8, .52), rgba(47, 27, 12, .18) 44%, transparent 74%);
  filter: blur(4px);
  transform-origin: right center;
  will-change: opacity, transform;
}

.archive-header h1:focus {
  outline: 1px dotted rgba(64, 42, 24, .6);
  outline-offset: .3rem;
}

@media (max-width: 1120px) {
  .book-transition-scene {
    display: none;
  }

  .page-turn-layer {
    display: none;
  }

  body.is-cover-transitioning .thread-mobile {
    pointer-events: none;
  }
}

@media (max-width: 760px) {
  .book-open-underlay {
    position: fixed;
    background-attachment: scroll;
  }

  body.is-page-turning .subpage-stage {
    overflow: visible;
  }
}

@media (prefers-reduced-motion: reduce) {
  .book-transition-scene {
    display: none;
  }

  body.is-cover-transitioning *,
  body.is-page-turning .thread-band,
  body.is-page-turning .thread-mobile,
  body.is-page-turning .archive-shell {
    scroll-behavior: auto !important;
  }
}

@media (max-width: 760px) {
  .cover-page .emblem-layer {
    inset: 0;
    width: auto;
    height: auto;
    aspect-ratio: auto;
    transform: none;
  }

  .cover-page .cover-symbol {
    --piece-x: 50%;
    --piece-y: 24%;
    --piece-width: 64%;
  }

  .cover-page .cover-wordmark {
    --piece-x: 47%;
    --piece-y: 45%;
    --piece-width: 42%;
  }

  .cover-page .cover-kanji {
    --piece-x: 73%;
    --piece-y: 22%;
    --piece-width: 10%;
  }

  .cover-page .cover-hanko {
    --piece-x: 72%;
    --piece-y: 42%;
    --piece-width: 10%;
  }
}
