/* Homepage hero: our books on a shelf, made like the library of Knihy, které se hrají (Jak-funguje-knihovna).
   On arrival the heading rises, the shelf draws out and the books hop onto it; a click opens the book (shelf.js). */
.shelf-hero { margin-top: 18px; box-sizing: border-box; padding: clamp(26px, 4vw, 50px) clamp(14px, 4vw, 48px) clamp(26px, 4vw, 42px); background: var(--yellow); border: 3px solid var(--ink); border-radius: 28px; text-align: center; position: relative; }
.shelf-hero .sh-kick { display: inline-block; background: var(--ink); color: var(--yellow); font-weight: 800; font-size: 13px; letter-spacing: .05em; text-transform: uppercase; border-radius: 999px; padding: 5px 13px; }
.shelf-hero h1 { font-size: clamp(2.4rem, 6.6vw, 4.8rem); margin: 14px 0 12px; }
.shelf-hero .lead { max-width: 42ch; margin: 0 auto clamp(26px, 4vw, 42px); font-size: 18px; color: var(--text); }
.shelf-hero .sh-cta { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: clamp(26px, 4vw, 38px); }

.bk-shelf { display: flex; justify-content: center; align-items: flex-start; gap: clamp(18px, 3vw, 44px); --w: clamp(96px, 12.6vw, 168px); --gap: clamp(10px, 1.8vw, 24px); }
.bk-label { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 4px; min-height: 30px; font-weight: 800; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; margin-bottom: 14px; }
.bk-label b { background: #fff; border: 2px solid var(--ink); border-radius: 999px; padding: 3px 10px; margin-left: 4px; letter-spacing: 0; }
.bk-row { display: flex; justify-content: center; align-items: flex-end; gap: var(--gap); padding: 0 8px; }
.bk-plank { display: block; height: 9px; background: var(--ink); border-radius: 5px; }
.bk-caps { display: flex; justify-content: center; gap: var(--gap); padding: 0 8px; margin-top: 10px; }
.bk-caps span { width: var(--w); font-weight: 700; font-size: clamp(12.5px, 1.25vw, 15px); line-height: 1.2; }

/* The book: a page block under a cover that swings open around its spine. */
.bk { all: unset; cursor: pointer; display: block; flex: none; width: var(--w); aspect-ratio: 3 / 4; position: relative; perspective: 1600px; container-type: inline-size; -webkit-tap-highlight-color: transparent; }
.bk:focus-visible { outline: 3px solid var(--ink); outline-offset: 6px; border-radius: 8px; }
.bk-3d { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .3s cubic-bezier(.2,.8,.2,1); }
.bk:active .bk-3d { transform: scale(.96); }
.bk.moving, .bk.moving .bk-cover, .bk.moving .bk-3d { will-change: transform; }
.bk-leaf { position: absolute; inset: 1.5% 1% 1.5% 0; transform-origin: left center; transform: translateZ(.5px); background: repeating-linear-gradient(0deg, #fffdf8 0 9px, #efe8db 9px 10px); border: 2px solid var(--ink); border-radius: 2px 8px 8px 2px; }
.bk-pages { position: absolute; inset: 3% 0 0 3%; background: repeating-linear-gradient(90deg, #fff 0 2px, #e7e0d4 2px 3px); border: 3px solid var(--ink); border-radius: 4px 10px 10px 4px; }
.bk-inside { position: absolute; inset: 0; background: #fffdf8; border: 3px solid var(--ink); border-radius: 4px 10px 10px 4px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6%; padding: 10%; text-align: center; }
.bk-inside svg { width: 46%; height: auto; overflow: visible; }
.bk-inside p { margin: 0; font-weight: 700; font-size: 7.4cqi; line-height: 1.3; color: var(--ink); }
.bk-cover { position: absolute; inset: 0; transform-origin: left center; transform-style: preserve-3d; transition: transform .45s cubic-bezier(.2,.8,.2,1); }
.bk-face { position: absolute; inset: 0; backface-visibility: hidden; -webkit-backface-visibility: hidden; border: 3px solid var(--ink); border-radius: 4px 10px 10px 4px; overflow: hidden; text-align: left; }
/* Safari hides a back face only when the face has a 3D transform of its own; .flipped hides the front where 3D is drawn flat */
.bk-front { transform: rotateY(0deg) translateZ(1px); z-index: 1; background: var(--c); color: var(--t); padding: 11% 10% 0 15%; display: flex; flex-direction: column; }
.bk.flipped .bk-front { visibility: hidden; }
.bk-front::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 7%; background: rgba(0, 0, 0, .14); border-right: 2px solid rgba(0, 0, 0, .25); z-index: 1; }
.bk-front.bk-img { padding: 0; }
.bk-front.bk-img img { width: 100%; height: 100%; object-fit: cover; object-position: top; display: block; }
.bk-back { transform: rotateY(180deg) translateZ(1px); background: var(--c); }
.bk-back::after { content: ""; position: absolute; inset: 6%; border-radius: 4px; background: radial-gradient(circle, rgba(255, 255, 255, .35) 1.5px, transparent 2px) 0 0 / 14px 14px; }
.bk-kicker { font-weight: 800; font-size: 5.6cqi; letter-spacing: .08em; text-transform: uppercase; opacity: .85; position: relative; line-height: 1.3; }
.bk-title { font-family: var(--wide); font-stretch: 118%; font-weight: 900; font-size: 10.4cqi; line-height: .98; margin-top: 3%; color: var(--h); position: relative; white-space: nowrap; letter-spacing: -.02em; }
.bk-art { position: absolute; left: 7%; right: 0; bottom: 0; height: 58%; }
.bk-art svg { position: absolute; }
.bk-art .bk-deco { left: 0; bottom: 0; width: 100%; height: 100%; }
.bk-art .bk-guide { position: absolute; right: 6%; bottom: 4%; width: 34%; height: auto; overflow: visible; }
.bk-inside img.bk-guide { width: 42%; height: auto; }

/* The nine books: text on the left and a bookcase with three shelves on the right; one column on a phone. */
.shelf-hero.case { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: clamp(24px, 4vw, 60px); text-align: left; padding: clamp(26px, 4vw, 52px); }
.case h1 { font-size: clamp(2.5rem, 5.4vw, 4.6rem); margin: 16px 0 14px; }
.case .hl { background: #fff; border: 3px solid var(--ink); border-radius: 16px; padding: 0 .14em; display: inline-block; transform: rotate(-2deg); }
.case .lead { margin: 0 0 22px; max-width: 34ch; }
.sh-prices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; max-width: 470px; }
.sh-prices a { position: relative; display: flex; flex-direction: column; gap: 2px; padding: 12px 12px 10px; background: #fff; border: 3px solid var(--ink); border-radius: 18px; text-decoration: none; transition: transform .15s; }
.sh-prices a:hover { transform: translateY(-2px); }
.sh-prices a.hot { background: var(--ink); color: #fff; }
.sh-prices b { font-family: var(--wide); font-stretch: 125%; font-weight: 900; font-size: clamp(1.25rem, 2vw, 1.6rem); letter-spacing: -.045em; line-height: 1.05; }
.sh-prices a.hot b { color: var(--yellow); }
.sh-prices span { font-weight: 700; font-size: 13.5px; line-height: 1.25; }
.sh-prices em { position: absolute; top: -11px; left: 10px; font-style: normal; font-weight: 800; font-size: 11px; letter-spacing: .04em; text-transform: uppercase; background: var(--yellow); color: var(--ink); border: 2px solid var(--ink); border-radius: 999px; padding: 1px 8px; }
.case .sh-cta { justify-content: flex-start; margin-top: 22px; }
.sh-trust { margin-top: 14px; font-weight: 600; font-size: 14.5px; color: var(--text); }
.case .bk-shelf { flex-direction: column; align-items: stretch; gap: 16px; --w: clamp(92px, 9.6vw, 126px); --gap: clamp(12px, 1.5vw, 20px); background: #fffdf8; border: 3px solid var(--ink); border-radius: 24px; padding: 14px 18px 16px; box-shadow: 0 8px 0 var(--ink); }
.case .bk-label { justify-content: flex-start; min-height: 0; margin: 0 0 8px; font-size: 12px; color: var(--muted); }
.case .bk-row { justify-content: flex-start; padding: 0 4px; }
.case .bk-caps { justify-content: flex-start; padding: 0 4px; margin-top: 6px; }
.case .bk-caps span { font-size: 13px; text-align: center; }
@media (max-width: 960px) {
  .shelf-hero.case { grid-template-columns: minmax(0, 1fr); text-align: center; }
  .case .lead, .sh-prices { margin-left: auto; margin-right: auto; }
  .case .sh-cta { justify-content: center; }
  .case .bk-shelf { justify-self: center; }
}
@media (max-width: 760px) {
  .case .bk-shelf { --w: min(25vw, 112px); --gap: 10px; gap: 12px; padding: 12px 10px 12px; width: 100%; box-shadow: 0 6px 0 var(--ink); }
  .case .bk-row, .case .bk-caps, .case .bk-label { justify-content: center; }
  .sh-prices { gap: 8px; }
  .sh-prices a { padding: 12px 8px 9px; border-radius: 16px; }
  .sh-prices span { font-size: 12.5px; }
  .sh-prices b { font-size: 1.16rem; }
}

/* a mouse over a book: it lifts and its cover opens a little */
@media (hover: hover) {
  .bk:hover .bk-3d { transform: translateY(-8px); }
  .bk:hover .bk-cover { transform: rotateY(-28deg); }
}

/* while a book opens, everything else steps back */
.shelf-hero.opening .sh-top, .shelf-hero.opening .bk-label, .shelf-hero.opening .bk-caps, .shelf-hero.opening .bk-plank, .shelf-hero.opening .sh-cta { transition: opacity .3s; opacity: 0; }
.bk-fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 90; }
.bk-fxl { position: fixed; z-index: 89; border-radius: 50%; pointer-events: none; transform: scale(0); will-change: transform, opacity; }

@media (max-width: 760px) {
  .bk-shelf { flex-direction: column; align-items: center; gap: 26px; --w: min(26vw, 118px); --gap: 12px; }
  .shelf-hero .lead { font-size: 17px; }
  .bk-label { margin-bottom: 10px; }
}
