*, *::before, *::after {
  box-sizing: border-box;
}

:root {
  --library-bg-start: 62px;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  color: #333;
  background-color: #f6f0e5;
  background-image: none;
  background-position: 0 4px;
  background-size: auto;
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
  font-size: 14px;
  line-height: 20px;
}

a {
  color: inherit;
}

button {
  color: inherit;
  font: inherit;
}

.b-shelf-container {
  position: relative;
  isolation: isolate;
  display: flex;
  flex-flow: wrap;
  justify-content: flex-start;
  align-items: flex-end;
  overflow: auto;
  background: none;
}

.b-shelf-container::before {
  content: "";
  position: absolute;
  top: var(--library-bg-start);
  right: 0;
  bottom: 0;
  left: 0;
  z-index: -1;
  pointer-events: none;
  background-image: url('../images/tiled_background_library.png');
  background-position: 0 calc(4px - var(--library-bg-start));
  background-repeat: repeat;
}

.e-library-item-wrapper {
  display: flex;
  flex-flow: column;
  justify-content: flex-end;
  align-items: flex-start;
  height: 440px;
  padding-top: 40px;
}

.e-book,
.e-paper,
.e-video {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  margin-top: auto;
  color: #183e68;
  background-color: #faf4e9;
  border: 2px solid #183e68;
  font-family: Merriweather, serif;
  line-height: 100%;
  text-decoration: none;
  transition: transform .2s cubic-bezier(.86, 0, .07, 1);
  transform-origin: center center;
}

.e-book {
  min-width: 80px;
  min-height: 240px;
  max-height: 440px;
  padding: 24px;
  border-left-width: 12px;
  border-top-left-radius: 6px;
  font-size: 1.6rem;
}

.e-book:hover {
  transform: rotate(2deg) translateY(-12px);
}

.e-paper {
  min-height: 240px;
  max-height: 440px;
  padding: 20px 16px;
  border-top-left-radius: 8px;
  font-size: 1.2rem;
}

.e-paper:hover {
  transform: translateY(-12px) rotate(1deg);
}

.e-video {
  width: 200px;
  height: 200px;
  padding: 16px;
  border-left-width: 12px;
  border-top-left-radius: 12px;
  font-size: 1.25rem;
}

.e-video:hover {
  transform: rotate(3deg) translateY(-12px);
}

.e-book.m-in-progress,
.e-paper.m-in-progress,
.e-video.m-in-progress {
  background-color: #e5857e;
  border-left-color: #b26862;
}

.e-book.m-complete,
.e-paper.m-complete,
.e-video.m-complete {
  color: #fff;
  background-color: #183e68;
  border-left-color: #122e4c;
}

.e-book-title {
  writing-mode: vertical-rl;
  rotate: 180deg;
}

.e-video-title {
  font-size: 1.2rem;
}

.e-video-icon {
  position: absolute;
  inset: 20%;
  background-color: transparent;
  border: 40px solid #00000014;
  border-radius: 120px;
}

.e-object {
  display: inline-block;
  position: static;
  padding-left: 20px;
  padding-right: 20px;
  text-decoration: none;
  transition: transform .2s cubic-bezier(.947, -1.121, .287, 1.447);
  transform-origin: center center;
}

.e-object:hover {
  transform: rotate(5deg);
}

.e-shelf-object {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  width: 100px;
  height: 120px;
  padding: 20px;
  cursor: pointer;
}

.e-object-shape,
.e-object-shape::before,
.e-object-shape::after {
  position: absolute;
  display: block;
  content: "";
}

.e-shelf-object.m-mug .e-object-shape {
  position: relative;
  width: 52px;
  height: 44px;
  background-color: #e5857e;
  border: 4px solid #183e68;
  border-radius: 4px 4px 12px 12px;
}

.e-shelf-object.m-mug .e-object-shape::after {
  top: 8px;
  right: -20px;
  width: 20px;
  height: 24px;
  background-color: transparent;
  border: 4px solid #183e68;
  border-left: 0;
  border-radius: 0 18px 18px 0;
}

.e-shelf-object.m-notebook .e-object-shape {
  position: relative;
  width: 54px;
  height: 72px;
  background-color: #faf4e9;
  border: 3px solid #183e68;
  border-left-width: 10px;
  border-radius: 3px 6px 6px 3px;
  rotate: -4deg;
}

.e-shelf-object.m-notebook .e-object-shape::after {
  inset: 12px 10px auto 12px;
  height: 2px;
  background-color: #e5857e;
  box-shadow: 0 12px 0 #e5857e, 0 24px 0 #e5857e;
}

.e-shelf-object.m-stone .e-object-shape {
  position: relative;
  width: 58px;
  height: 38px;
  background-color: #183e68;
  border: 5px solid #122e4c;
  border-radius: 48% 42% 44% 52%;
  rotate: -3deg;
}

.e-shelf-object.m-cassette .e-object-shape {
  position: relative;
  width: 68px;
  height: 46px;
  background:
    radial-gradient(circle at 23px 21px, #faf4e9 0 5px, #183e68 6px 9px, transparent 10px),
    radial-gradient(circle at 45px 21px, #faf4e9 0 5px, #183e68 6px 9px, transparent 10px),
    #e5857e;
  border: 4px solid #183e68;
  border-radius: 4px;
}

.e-shelf-object.m-cassette .e-object-shape::after {
  left: 14px;
  bottom: 5px;
  width: 32px;
  height: 8px;
  border: 2px solid #183e68;
  transform: skew(-12deg);
}

.e-shelf-object.m-monitor .e-object-shape {
  position: relative;
  width: 70px;
  height: 52px;
  background-color: #faf4e9;
  border: 5px solid #183e68;
  border-radius: 6px;
}

.e-shelf-object.m-monitor .e-object-shape::before {
  inset: 7px;
  background-color: #e5857e;
  border: 2px solid #122e4c;
}

.e-shelf-object.m-monitor .e-object-shape::after {
  left: 23px;
  bottom: -18px;
  width: 18px;
  height: 16px;
  background-color: #183e68;
  border-bottom: 5px solid #122e4c;
}

.e-shelf-object.m-camera .e-object-shape {
  position: relative;
  width: 64px;
  height: 44px;
  background-color: #e5857e;
  border: 4px solid #183e68;
  border-radius: 6px;
}

.e-shelf-object.m-camera .e-object-shape::before {
  inset: 7px 0 0;
  width: 24px;
  height: 24px;
  margin: auto;
  background-color: #faf4e9;
  border: 5px solid #183e68;
  border-radius: 50%;
}

.e-shelf-object.m-camera .e-object-shape::after {
  top: -10px;
  left: 8px;
  width: 20px;
  height: 10px;
  background-color: #183e68;
  border-radius: 3px 3px 0 0;
}

.e-shelf-object.m-compass .e-object-shape {
  position: relative;
  width: 56px;
  height: 56px;
  background-color: #faf4e9;
  border: 5px solid #183e68;
  border-radius: 50%;
}

.e-shelf-object.m-compass .e-object-shape::before {
  inset: 8px;
  background-color: #e5857e;
  clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
}

.e-shelf-object.m-key .e-object-shape {
  position: relative;
  width: 64px;
  height: 18px;
  background-color: #183e68;
  border-radius: 10px 2px 2px 10px;
  rotate: -8deg;
}

.e-shelf-object.m-key .e-object-shape::before {
  top: -9px;
  left: -12px;
  width: 34px;
  height: 34px;
  background-color: #faf4e9;
  border: 7px solid #183e68;
  border-radius: 50%;
}

.e-shelf-object.m-key .e-object-shape::after {
  right: 3px;
  bottom: -10px;
  width: 20px;
  height: 12px;
  border-right: 7px solid #183e68;
  border-bottom: 7px solid #183e68;
}

.e-cat-trigger {
  cursor: pointer;
}

.e-pot {
  position: relative;
  width: 60px;
  height: 60px;
  background-color: #e5857e;
  border-style: solid;
  border-width: 8px 2px 4px 6px;
  border-color:
    #183e68
    #b26862
    #b26862
    #b26862;
  border-bottom-right-radius: 40px;
  border-bottom-left-radius: 40px;
}

.e-plant {
  position: absolute;
  inset: -80px 0 auto;
  width: 4px;
  height: 80px;
  margin-left: auto;
  margin-right: auto;
  background-color: #183e68;
}

.e-berries {
  position: relative;
  top: -30px;
  left: -28px;
  display: flex;
  flex-flow: wrap;
  gap: 18px;
  width: 60px;
  height: 60px;
  background-color: #183e68;
  border-top: 6px solid #122e4c;
  border-bottom: 2px solid #122e4c;
  border-right: 12px solid #122e4c;
  rotate: 45deg;
}

.e-berry {
  width: 8px;
  height: 8px;
  margin: auto;
  background-color: #e5857e;
}

.e-s-leaves-container {
  position: relative;
  top: -30px;
  left: -28px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 60px;
  height: 60px;
}

.e-flower-petal {
  position: relative;
  width: 30px;
  height: 30px;
  background-color: #183e68;
  border-top: 6px solid #122e4c;
  border-bottom: 2px solid #122e4c;
  border-right: 12px solid #122e4c;
  rotate: 45deg;
}

.e-flower-center {
  position: absolute;
  inset: 0;
  width: 15px;
  height: 15px;
  margin: auto;
  background-color: #e5857e;
  rotate: 45deg;
}

.e-cat-b {
  position: relative;
  width: 60px;
  height: 48px;
  margin-bottom: 4px;
  background-color: #183e68;
  border-radius: 15px 15px 40px 40px;
}

.e-cat-h {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  width: 40px;
  height: 30px;
  margin-left: auto;
  margin-right: auto;
  background-color: #183e68;
  border-radius: 20px 20px 0 0;
}

.e-cat-e-r,
.e-cat-e-l {
  position: relative;
  top: -3px;
  width: 15px;
  height: 20px;
  margin-left: auto;
  margin-right: auto;
  background-color: #183e68;
}

.e-cat-e-r {
  border-top-left-radius: 90px;
}

.e-cat-e-l {
  border-top-right-radius: 90px;
}

.e-cat-r,
.e-cat-l {
  position: absolute;
  bottom: 0;
  width: 15px;
  height: 35px;
  background-color: #183e68;
  border-bottom: 10px solid #122e4c;
}

.e-cat-r {
  right: 0;
}

.e-cat-l {
  left: 0;
}

.e-cat-f {
  position: relative;
  top: -25px;
  color: #000;
  text-align: center;
  font-size: 23px;
}

.e-cat-collar {
  position: absolute;
  inset: 0 0 auto;
  width: 40px;
  height: 2px;
  margin-left: auto;
  margin-right: auto;
  background-color: #e5857e;
}

.e-cat-collar-pendant {
  position: absolute;
  inset: 0 0 auto;
  width: 8px;
  height: 8px;
  margin-left: auto;
  margin-right: auto;
  background-color: #d37b74;
}

.b-header {
  position: fixed;
  inset: 0 0 auto;
  z-index: 99;
  padding: 10px 5px 0;
}

.b-header-bar,
.b-footer-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  padding: 5px 10px 5px 10px;
  color: #fff;
  background-color: #183e68;
  border: 4px solid #122e4c;
}

.b-header-bar {
  border-radius: 15px;
}

.b-footer {
  padding-bottom: 10px;
}

.b-footer-bar {
  margin-top: 20px;
  border-radius: 15px;
}

.e-page-title {
  margin: 0;
  font-family: Merriweather, serif;
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 100%;
  text-align: left;
}

.b-button-group {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

.e-button {
  display: inline-block;
  width: 40px;
  height: 40px;
  padding: 8px;
  color: #fff;
  background-color: #e5857e;
  border: 0;
  border-radius: 60px;
  font-family: "Merriweather Sans", sans-serif;
  font-size: 1rem;
  line-height: 140%;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .2s cubic-bezier(.165, .84, .44, 1);
}

.e-button:hover {
  background-color: #b26862;
}

.e-text-link {
  color: #fff;
  font-family: "Merriweather Sans", sans-serif;
  font-size: .875rem;
  text-decoration: none;
}

.e-text-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Bibliographic card */
.b-overlay {
  position: fixed;
  inset: auto 0 0;
  z-index: 100;
  pointer-events: none;
}

.e-card {
  display: flex;
  flex-flow: column;
  justify-content: flex-start;
  gap: 5px;
  width: min(640px, calc(100vw - 20px));
  max-height: calc(100vh - 20px);
  margin: 0 10px 10px auto;
  padding: 20px;
  color: #183e68;
  background-color: #faf4e9;
  border: 2px solid #183e68;
  border-right-width: 10px;
  border-top-left-radius: 8px;
  font-family: Merriweather, serif;
  overflow: auto;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate3d(0, 18px, 0) scale(.985) rotate(.35deg);
  transform-origin: right bottom;
  transition:
    opacity .14s ease,
    transform .2s cubic-bezier(.22, 1, .36, 1),
    visibility 0s linear .2s;
}

.b-overlay.is-open .e-card {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate3d(0, 0, 0) scale(1) rotate(0);
  transition:
    opacity .16s ease,
    transform .24s cubic-bezier(.16, 1, .3, 1),
    visibility 0s;
}

.e-card-book-title {
  margin: 0 0 5px;
}

.b-meta-spacer {
  display: flex;
  justify-content: space-between;
  gap: 4px;
}

.e-meta-copy {
  font-family: "Merriweather Sans", sans-serif;
  font-size: .875rem;
}

.e-card-description {
  margin: 4px 0 2px;
  line-height: 1.45;
}

.e-card-identifier {
  align-self: flex-start;
  overflow-wrap: anywhere;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.e-card-identifier:not([href]) {
  text-decoration: none;
}

.physics-active .e-book,
.physics-active .e-paper,
.physics-active .e-video,
.physics-active .e-object {
  transition: none;
  will-change: transform;
  user-select: none;
}


.e-shelf-object {
  padding-left: 20px;
  padding-right: 20px;
}

.e-coffee-mug {
  position: relative;
  width: 50px;
  height: 50px;
  background-color: #e5857e;
  border-top: 8px solid #2c2514;
  border-right: 2px solid #b26862;
  border-bottom: 4px solid #b26862;
  border-left: 6px solid #b26862;
  border-bottom-right-radius: 40px;
  border-bottom-left-radius: 40px;
}

.e-mug-handle {
  position: absolute;
  inset: 0 0 0 auto;
  width: 15px;
  height: 20px;
  margin-right: -15px;
  border: 8px solid #b26862;
  border-left-width: 0;
  border-top-right-radius: 30px;
  border-bottom-right-radius: 30px;
}

.e-compass {
  position: relative;
  width: 60px;
  height: 60px;
  background-color: #183e68;
  border: 10px solid #122e4c;
  border-radius: 90px;
}

.e-compass-hand {
  position: absolute;
  inset: -20% 50% auto auto;
  width: 5px;
  height: 30px;
  margin-right: -3px;
  background-color: #e5857e;
  border-radius: 90px;
}

@media screen and (max-width: 991px) {
  .e-video {
    width: auto;
    max-width: 140px;
  }
}

@media screen and (max-width: 767px) {
  .e-video {
    max-width: 160px;
  }

  .b-meta-spacer {
    flex-wrap: wrap;
  }

  .b-footer-bar {
    align-items: flex-start;
  }

  .b-footer-bar .b-button-group {
    flex-wrap: wrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  .e-card,
  .b-overlay.is-open .e-card {
    transition: none;
    transform: none;
  }
}
