/* The scene coordinates preserve the original desktop collage. */
.home-page {
  --shelf-focus: #8f3d2f;
  --shelf-motion: 300ms;
  background: #fff;
}

.home-page #horizon {
  position: static;
  display: flex;
  align-items: center;
  min-height: 100svh;
  width: 100%;
}

.home-page #content {
  position: static;
  width: 960px;
  max-width: 100%;
  margin: 0 auto;
}

.home-page .main {
  height: auto;
  overflow: visible;
}

.home-page .home-bookshelf {
  margin: 0;
}

.home-page .library {
  position: relative;
  isolation: isolate;
  width: 710px;
  height: 600px;
  margin: 0;
}

.home-page .library::before,
.home-page .library::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: url(../img/background_color.jpg) left top / 135.211268% 100% no-repeat;
}

.home-page .library::after {
  background-image: url(../img/background_white.jpg);
  opacity: 0;
  transition: opacity var(--shelf-motion) ease;
}

.home-page.is-library-active .library::after {
  opacity: 1;
}

.home-page .library-link {
  position: absolute;
  display: block;
  left: var(--object-x);
  top: var(--object-y);
  width: var(--object-width);
  border-radius: 4px;
}

/* Expand the hit area without enlarging the illustrated object. */
.home-page .library-link::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: max(100%, 44px);
  height: max(100%, 44px);
  transform: translate(-50%, -50%);
  border-radius: 5px;
}

.home-page .library-link:focus-visible {
  outline: none;
}

.home-page .library-link:focus-visible::before {
  outline: 2px solid var(--shelf-focus);
  outline-offset: 4px;
  box-shadow: 0 0 0 4px #fff;
}

.home-page .object {
  position: static;
  display: block;
  width: 100%;
  height: auto;
  max-width: none;
}

.home-page .library-link-bio {
  --object-x: 12.084507%;
  --object-y: 70%;
  --object-width: 3.521127%;
}

.home-page .library-link-teatro {
  --object-x: 77.577465%;
  --object-y: 50%;
  --object-width: 4.788732%;
}

.home-page .library-link-cinema {
  --object-x: 40.957746%;
  --object-y: 33.333333%;
  --object-width: 11.126761%;
}

.home-page .library-link-immagini {
  --object-x: 60.676056%;
  --object-y: 59.166667%;
  --object-width: 5.774648%;
}

.home-page .library-link-ricordi {
  --object-x: 14.197183%;
  --object-y: 52.5%;
  --object-width: 8.732394%;
}

@keyframes bookshelf-rock {
  25% { transform: rotate(25deg); }
  75% { transform: rotate(-25deg); }
}

.home-page .libraryobject {
  animation: bookshelf-rock 1s linear infinite;
}

.home-page .navLink.is-library-active {
  text-decoration: underline;
}

.home-page .title a:focus-visible,
.home-page .navLink:focus-visible,
.home-page #language_chooser a:focus-visible,
.home-page #language_chooser button:focus-visible {
  outline: 2px solid var(--shelf-focus);
  outline-offset: 4px;
}

@media (min-width: 980px) {
  .home-page #content {
    height: 600px;
  }

  .home-page #language_chooser ul {
    display: flex;
    justify-content: flex-end;
    gap: 4px;
  }

  .home-page #language_chooser form {
    margin: 0;
  }

  .home-page #language_chooser a,
  .home-page #language_chooser button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 24px;
    font-size: 12px;
    opacity: 0.8;
  }

  .home-page #language_chooser .activo {
    opacity: 1;
  }

  .home-page .header-container nav {
    margin-top: 45px;
  }
}

@media (max-width: 979px) {
  .home-page #horizon {
    align-items: flex-start;
  }

  .home-page #content {
    width: min(710px, calc(100% - 32px));
    padding: 16px 0 28px;
  }

  .home-page .superwrapper {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 16px 8px;
  }

  .home-page .header-container,
  .home-page .affixheader {
    display: contents;
  }

  .home-page #topnav {
    grid-column: 1;
    grid-row: 1;
    margin: 0;
    align-self: center;
  }

  .home-page .title {
    float: none;
    width: auto;
    font-size: clamp(30px, 9vw, 44px);
    line-height: 1.2;
  }

  .home-page .title img {
    max-width: 100%;
    width: 210px;
    height: auto;
  }

  .home-page #language_chooser {
    grid-column: 2;
    grid-row: 1;
    align-self: center;
  }

  .home-page #language_chooser ul {
    display: flex;
  }

  .home-page #language_chooser form {
    margin: 0;
  }

  .home-page #language_chooser a,
  .home-page #language_chooser button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    min-height: 44px;
    font-size: 14px;
    opacity: 0.8;
  }

  .home-page #language_chooser .activo {
    text-decoration: underline;
    text-underline-offset: 5px;
    opacity: 1;
  }

  .home-page #nav-anchors {
    display: none;
  }

  .home-page .main-container {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    margin: 0;
  }

  .home-page .library {
    width: 100%;
    height: auto;
    aspect-ratio: 710 / 600;
  }

  .home-page #nav {
    grid-column: 1 / -1;
    grid-row: 3;
    margin: 0;
  }

  .home-page #nav ul {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 4px 12px;
  }

  .home-page #nav a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    margin: 0;
    padding: 4px 0;
    font-size: clamp(25px, 6vw, 30px);
    line-height: 1.3;
    text-align: center;
  }

  .home-page.japaneseBody #nav a {
    font-family: inherit;
    font-size: clamp(16px, 4.3vw, 21px);
  }

  .home-page .navfooter {
    display: block;
    grid-column: 1 / -1;
    grid-row: 4;
    padding-top: 16px;
    text-align: center;
  }

  .home-page .navfooter blockquote {
    font-size: 22px;
    line-height: 1.45;
  }

  .home-page .navfooter img {
    width: auto;
    max-width: 100%;
  }

  .home-page .navfooter p {
    margin-top: 16px;
    color: #655b55;
    font-size: 11px;
  }

  .home-page .footer-container {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-page .libraryobject {
    animation: none;
  }

  .home-page .library::after {
    transition: none;
  }
}
