/* Homepage guidance and the open library share the available space. */
body:has(#empty-state:not([style*="display: none"])) {
  --welcome-drawer-width: min(560px, 44vw);
}

body:has(#empty-state:not([style*="display: none"])) .lesson-overlay.open {
  background: transparent;
}

.layout:has(#empty-state:not([style*="display: none"])) > .sidebar {
  display: none;
}

#empty-state {
  width: 100%;
  min-height: 0;
  padding: clamp(20px, 4vw, 56px);
  gap: clamp(14px, 3vh, 32px);
  overflow-y: auto;
  justify-content: safe center;
}

#empty-state h2 {
  width: min(100%, 12ch);
  margin: 0;
  font-size: clamp(2.1rem, 4.9vw, 4.4rem);
  font-weight: 850;
  letter-spacing: -.065em;
  line-height: 1;
  text-wrap: balance;
}

#empty-state .welcome-artwork {
  width: min(100%, clamp(155px, 30vh, 250px));
  height: auto;
  max-height: 30vh;
  object-fit: contain;
  flex: 0 0 auto;
}

.welcome-callouts {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px 24px;
  width: min(100%, 650px);
  padding: 12px 6px;
  flex: 0 0 auto;
}

.welcome-note {
  position: relative;
  flex: 1 1 170px;
  max-width: 255px;
  display: grid;
  align-content: center;
  gap: 6px;
  padding: 15px 42px 15px 17px;
  border: 2px solid #191714;
  border-radius: 17px 17px 17px 4px;
  background: #ffdc46;
  box-shadow: 4px 5px 0 #191714;
  color: #191714;
  font: inherit;
  line-height: 1.3;
  text-align: left;
  transform: rotate(-3deg);
  cursor: pointer;
  transition: transform .18s ease, box-shadow .18s ease;
}

.welcome-note--account {
  background: #e2d8ff;
  transform: rotate(2deg);
}

.welcome-note strong {
  font-size: clamp(1.02rem, 2vw, 1.42rem);
  letter-spacing: -.035em;
  line-height: 1.12;
}

.welcome-note > span:not(.welcome-note-arrow) {
  font-size: .88rem;
}

.welcome-note:hover,
.welcome-note:focus-visible {
  transform: rotate(0) translateY(-3px);
  box-shadow: 4px 8px 0 #191714;
}

.welcome-note-arrow {
  position: absolute;
  top: 12px;
  right: 12px;
  display: grid;
  place-items: center;
  width: 24px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: #191714;
  color: white;
  font-family: system-ui, sans-serif;
  font-size: 16px;
  font-weight: 750;
  line-height: 1;
  pointer-events: none;
}

body:has(#account-menu .account-menu-profile) .welcome-note--account {
  display: none;
}

@media (prefers-reduced-motion: reduce) {
  .welcome-note { transition: none; }
}

@media (min-width: 800px) {
  body:has(#empty-state:not([style*="display: none"])) .lesson-overlay.open {
    pointer-events: none;
  }

  body:has(#empty-state:not([style*="display: none"])) .lesson-pane {
    width: var(--welcome-drawer-width);
  }

  body:has(.lesson-pane.open) .layout:has(#empty-state:not([style*="display: none"])) {
    padding-right: var(--welcome-drawer-width);
  }
}
