/* Pagina "Il Libro" — riprende la copertina: foto seppia, titolo color colofonia,
   e le quattro corde verticali, una per ogni lingua. Tutto è limitato a .book. */
.book {
  --b-bg: #2a2420;
  --b-bg-2: #342d28;
  --b-ivory: #efe8de;
  --b-ivory-2: #c9bfb2;
  --b-rosin: #e3a062;
  --b-line: rgba(239, 232, 222, .28);
  --b-pad: clamp(1.25rem, 5vw, 4rem);
  background: var(--b-bg); color: var(--b-ivory);
  font-size: 1.15rem; line-height: 1.65;
}
.book :lang(zh), .book:lang(zh) { font-family: "Songti SC", "STSong", "Noto Serif SC", "Noto Serif CJK SC", "Source Han Serif SC", "SimSun", serif; line-height: 1.85; }
.book :lang(ja), .book:lang(ja) { font-family: "Hiragino Mincho ProN", "Yu Mincho", "YuMincho", "Noto Serif JP", "Noto Serif CJK JP", serif; line-height: 1.85; }
.book img { max-width: 100%; height: auto; display: block; }
.book a { color: var(--b-rosin); }
.book a:hover { color: #f2bb85; }

/* lingua visibile */
.js .book [data-l]:not(.on) { display: none !important; }
.no-js .book [data-l]:not([data-l="it"]) { display: none !important; }
.site-nav[hidden] { display: none; }

/* bandiere */
.flag { display: inline-block; width: 1.5em; height: 1em; object-fit: cover; border-radius: 2px; box-shadow: 0 0 0 1px rgba(0,0,0,.18); flex: none; }
.flag--ja { box-shadow: 0 0 0 1px rgba(0,0,0,.25); }

/* selettore lingua */
.book .langs {
  display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 2rem;
  font-family: var(--sans); font-size: .92rem;
}
.book .langs a {
  display: inline-flex; align-items: center; gap: .55rem;
  padding: .45rem .8rem .45rem .55rem; border-radius: 2px;
  color: var(--b-ivory-2); text-decoration: none; border: 1px solid var(--b-line);
}
.book .langs a:hover { color: var(--b-ivory); border-color: var(--b-ivory-2); }
.book .langs a[aria-current] { color: var(--b-bg); background: var(--b-ivory); border-color: var(--b-ivory); }
.book .langs .flag { width: 1.6rem; height: 1.07rem; }
@media (max-width: 480px) {
  .book .langs { gap: .3rem; }
  .book .langs a { gap: .4rem; padding: .4rem .5rem; font-size: .8rem; }
  .book .langs .flag { width: 1.3rem; height: .87rem; }
}

/* apertura */
.book .bk-hero {
  position: relative;
  display: grid; gap: 2.5rem 4rem; align-items: center;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
  min-height: calc(100vh - var(--nav-h)); min-height: calc(100svh - var(--nav-h));
  max-width: 82rem; margin: 0 auto;
  padding: 3rem var(--b-pad) 4rem;
  overflow: hidden;
}
.book .strings-bg {
  /* prosegue le quattro corde disegnate sulla copertina */
  position: absolute; top: -100vh; bottom: -100vh; left: 39.6%;
  width: 20.4%; margin: 0; padding: 0; list-style: none; z-index: -1;
  display: flex; justify-content: space-between;
  pointer-events: none;
}
.book .strings-bg li { width: 1px; background: var(--b-line); transform-origin: top; }
@media (prefers-reduced-motion: no-preference) {
  .book .strings-bg li { animation: string-in 1.6s cubic-bezier(.2,.7,.1,1) both; }
  .book .strings-bg li:nth-child(2) { animation-delay: .08s; }
  .book .strings-bg li:nth-child(3) { animation-delay: .16s; }
  .book .strings-bg li:nth-child(4) { animation-delay: .24s; }
  @keyframes string-in { from { transform: scaleY(0); } }
}
.book .hero__text { position: relative; z-index: 1; max-width: 36rem; }
.book .bk-hero h1 { margin: 0 0 .75rem; font-weight: 400; display: flex; flex-direction: column-reverse; }
.book .h1-title {
  color: var(--b-rosin);
  font-size: clamp(2.6rem, 6.4vw, 5rem);
  line-height: 1.02;
  letter-spacing: .01em;
}
.book .h1-author { font-size: clamp(1.2rem, 2vw, 1.5rem); letter-spacing: .05em; margin-bottom: .6rem; color: var(--b-ivory); }
.book :lang(zh) .h1-title, .book :lang(ja) .h1-title, .book h1:lang(zh) .h1-title, .book h1:lang(ja) .h1-title { letter-spacing: .08em; line-height: 1.2; }
.book .sub { margin: 0 0 1.75rem; font-style: italic; color: var(--b-ivory-2); }
.book .sub:lang(zh), .book .sub:lang(ja) { font-style: normal; }
.book .lead { font-size: clamp(1.2rem, 1.8vw, 1.4rem); line-height: 1.55; margin: 0 0 2rem; }
.book .cta { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.25rem; margin: 0; font-family: var(--sans); }
.book .cta .meta { font-size: .9rem; color: var(--b-ivory-2); }
.book .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  padding: .75rem 1.2rem; border: 1px solid var(--b-ivory-2); border-radius: 2px;
  color: var(--b-ivory); text-decoration: none; font-family: var(--sans); font-size: .95rem;
  transition: background-color .2s, color .2s, border-color .2s;
}
.book .btn:hover { background: var(--b-ivory); color: var(--b-bg); border-color: var(--b-ivory); }
.book .btn--solid { background: var(--b-rosin); border-color: var(--b-rosin); color: #1f1a16; font-weight: 600; }
.book .btn--solid:hover { background: #f0b57c; border-color: #f0b57c; color: #1f1a16; }
.book .btn-link { font-size: .92rem; color: var(--b-ivory-2); }

.book .hero__cover { position: relative; z-index: 0; justify-self: center; width: min(100%, 22rem); isolation: isolate; }
.book .hero-cover { display: block; }
.book .hero-cover img { width: 100%; box-shadow: 0 30px 60px -20px rgba(0,0,0,.7), 0 0 0 1px rgba(255,255,255,.06); }

/* citazione */
.book .quote {
  margin: 0 auto; padding: clamp(3rem, 8vw, 6rem) var(--b-pad);
  max-width: 52rem; text-align: center;
  border-top: 1px solid var(--b-line);
}
.book .quote blockquote { margin: 0; font-style: italic; font-size: clamp(1.4rem, 2.6vw, 1.95rem); line-height: 1.45; }
.book .quote blockquote:lang(zh), .book .quote blockquote:lang(ja) { font-style: normal; }
.book .quote blockquote::before { content: "“"; } .book .quote blockquote::after { content: "”"; }
.book .quote blockquote:lang(zh)::before, .book .quote blockquote:lang(ja)::before { content: "「"; }
.book .quote blockquote:lang(zh)::after, .book .quote blockquote:lang(ja)::after { content: "」"; }
.book .quote figcaption { margin-top: 1.25rem; font-family: var(--sans); font-size: .95rem; color: var(--b-ivory-2); }

/* il libro */
.book .about {
  display: grid; gap: 1rem 4rem;
  grid-template-columns: minmax(0, 14rem) minmax(0, 38rem);
  justify-content: center;
  padding: clamp(3rem, 7vw, 5rem) var(--b-pad);
  background: var(--b-bg-2);
}
.book .about h2, .book .downloads h2, .book .foundation h2 { margin: 0; font-weight: 400; font-size: 1.6rem; line-height: 1.2; }
.book .about p { margin: 0 0 1.1em; }
.book .about .credits { font-family: var(--sans); font-size: .92rem; color: var(--b-ivory-2); line-height: 1.55; margin-top: 1.75rem; }
.book .credits:lang(zh), .book .credits:lang(ja) { font-family: inherit; }
.book .ebook { font-family: var(--sans); font-size: .95rem; }

/* quattro lingue, quattro corde */
.book .downloads { padding: clamp(3rem, 7vw, 5.5rem) var(--b-pad); max-width: 82rem; margin: 0 auto; }
.book .downloads > h2 { margin-bottom: 2.25rem; }
.book .strings { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.book .string {
  position: relative; display: flex; flex-direction: column; align-items: flex-start;
  padding: 0 1.5rem;
  border-left: 1px solid var(--b-line);
}
.book .string__cover { display: block; width: 100%; margin-bottom: 1.25rem; }
.book .string__cover img { width: 100%; box-shadow: 0 20px 40px -20px rgba(0,0,0,.7); transition: transform .4s cubic-bezier(.2,.7,.1,1); }
.book .string:hover .string__cover img { transform: translateY(-4px); }
.book .string__lang { display: flex; align-items: center; gap: .55rem; margin: 0; font-family: var(--sans); font-size: .95rem; color: var(--b-ivory); }
.book .string__lang .flag { width: 1.7rem; height: 1.13rem; }
.book .string__title { margin: .45rem 0 .1rem; font-weight: 400; font-size: 1.3rem; line-height: 1.25; color: var(--b-rosin); }
.book .string__author { margin: 0 0 .5rem; font-size: 1rem; }
.book .string__meta { margin: 0 0 1.1rem; font-family: var(--sans); font-size: .85rem; color: var(--b-ivory-2); }
.book .string .btn { margin-top: auto; }
[data-lang="it"] .book .string:lang(it) .btn, [data-lang="en"] .book .string:lang(en) .btn,
[data-lang="zh"] .book .string:lang(zh) .btn, [data-lang="ja"] .book .string:lang(ja) .btn {
  background: var(--b-rosin); border-color: var(--b-rosin); color: #1f1a16; font-weight: 600;
}
.book .cta .btn--solid .flag { width: 1.35rem; height: .9rem; box-shadow: 0 0 0 1px rgba(0,0,0,.3); }

@media (max-width: 900px) {
  .book .bk-hero { grid-template-columns: 1fr; min-height: 0; padding-top: 2rem; }
  .book .hero__cover { order: -1; width: min(60%, 16rem); justify-self: start; }
  .book .strings-bg { top: -3rem; bottom: -2rem; }
  .book .about { grid-template-columns: 1fr; }
  .book .strings { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 3rem; }
}
@media (max-width: 480px) {
  .book .strings { grid-template-columns: 1fr; }
  .book .string__cover { width: 60%; }
}

/* fondazione */
.book .foundation {
  display: grid; grid-template-columns: auto minmax(0, 38rem); gap: 2rem; justify-content: center; align-items: start;
  padding: clamp(3rem, 7vw, 5rem) var(--b-pad);
  border-top: 1px solid var(--b-line);
}
.book .foundation img { width: 5rem; margin-top: .3rem; }
.book .foundation p { margin: .9rem 0; }
.book .links { list-style: none; padding: 0; margin: 1rem 0; display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; font-family: var(--sans); font-size: .95rem; }
@media (max-width: 600px) { .book .foundation { grid-template-columns: 1fr; } }
