.book-door {
  border: 0;
  padding: 0;
  width: min(100%, 560px);
  max-width: 100%;
  height: 100dvh;
  max-height: 100dvh;
  margin: auto;
  background: #fffaf0;
  color: #30253a;
  overflow-y: auto;
}
.book-door[open] { display: flex; flex-direction: column; }
.book-door::backdrop { background: #cfdfd8; }
.book-landscape {
  position: relative;
  display: grid;
  flex: 1 0 45%;
  min-height: 185px;
  place-items: end center;
  isolation: isolate;
  background: radial-gradient(ellipse at 50% 85%, #fff1ae 0%, transparent 57%), linear-gradient(#90d4d0, #e8f7dd);
  overflow: hidden;
}
.book-landscape::before, .book-landscape::after {
  content: '';
  position: absolute;
  z-index: -1;
  width: 110%; height: 34%; bottom: -13%; left: -44%;
  border-radius: 50%; background: #96c585; transform: rotate(13deg);
}
.book-landscape::after { left: 27%; bottom: -16%; background: #68ae8a; transform: rotate(-13deg); }
.book-landscape .brand-art { width: min(82%, 36dvh, 345px); height: auto; margin-bottom: 17px; filter: drop-shadow(0 9px 12px #405e5829); }
.door-star { position: absolute; color: #fffcec; font-size: 24px; left: 13%; top: 25%; animation: door-glow 3s ease-in-out infinite alternate; }
.door-star:last-child { left: auto; right: 11%; top: 45%; font-size: 18px; animation-delay: -1s; }
@keyframes door-glow { to { opacity: .48; transform: translateY(-4px); } }
.door-page { position: relative; flex: 0 0 auto; text-align: center; padding: 23px 22px max(9dvh, 28px); }
.door-page::before { content: ''; background: #fffaf0; position: absolute; top: -18px; left: 0; width: 100%; height: 32px; border-radius: 50% 54% 0 0 / 100% 100% 0 0; }
.door-page h1 { font: 400 clamp(43px, 11vw, 66px)/1.1 var(--fantasy); color: #4b305c; margin: 0; }
.door-page p { margin: 11px auto 27px; font: 700 20px/1.4 Nunito, sans-serif; }
.door-page button { display: inline-flex; align-items: center; gap: 15px; padding: 16px 25px; border-radius: 99px; background: linear-gradient(110deg,#177d79,#424687); color: white; font: 800 17px Nunito,sans-serif; }
.door-page button svg { width: 19px; }
.story-card { --tile: #e4eee3; background: var(--tile); border-radius: 22px; overflow: hidden; }
.story-card.hue-1 { --tile: #f6e5cd; } .story-card.hue-2 { --tile: #ece4f0; } .story-card.hue-3 { --tile: #dfeef1; }
.story-card .card-copy { text-align: center; padding: 12px 9px 17px; }
.story-card .cover-button, .story-card .cover-button .art { border-radius: 0; }
.story-card .card-copy p { display: none; }
.story-card .category-label { font-size: 13px; color: #53604e; }
.story-card .title-button { text-align: center; }
.brand small { display: none; }
.brand>span { font: 400 28px/1 var(--fantasy); color: #4b305c; }
.brand>span>span { color: inherit; }
@media(prefers-reduced-motion: reduce) { .door-star { animation: none; } }

.app-header .install-shortcut {
  display: grid;
  place-items: center;
  grid-template: 1fr / 1fr;
  padding: 0;
  gap: 0;
  box-sizing: border-box;
  flex: 0 0 46px;
  box-shadow: 0 3px 9px #3e443516;
}
.app-header .install-shortcut svg { display: block; margin: 0; }
.mobile-nav { box-shadow: 0 4px 10px #37453412, 0 12px 32px #37453435; }
.reader-top .icon-button, .reader-brand { box-shadow: 0 3px 10px #293a3033; }
.shuffle-dialog, #install { box-shadow: 0 8px 20px #293a3026, 0 22px 48px #293a3033; }

@media (min-width: 640px) {
  .app-shell { max-width: 1440px; padding-inline: clamp(24px, 4vw, 64px); }
  .app-header, main { padding-inline: 0; }
  .library { margin-top: 12px; }
  .library .search-controls { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; }
  .search-mode { width: auto; }
  .categories { margin-inline: 0; padding-inline: 0; flex-wrap: wrap; }
  .story-grid { grid-template-columns: repeat(3,minmax(0,1fr)); gap: 24px 18px; }
  .section-title h1 { max-width: none; font-size: 28px; }
  .story-card h3 { font-size: clamp(21px,2.25vw,28px); }
  .resume { max-width: 640px; }
  .book-door { width: min(900px,94vw); height: min(560px,90dvh); border-radius: 32px; }
  .book-door[open] { display: grid; grid-template-columns: 1fr 1fr; }
  .book-landscape { place-items: center; }
  .book-landscape .brand-art { width: 86%; margin: 0; }
  .door-page { display: grid; align-content: center; justify-items: center; padding: 24px; }
  .door-page::before { display: none; }
  .door-page h1 { font-size: clamp(39px,6vw,62px); }
  .reader { width: min(92vw,840px); max-width: none; }
  .reading { padding-inline: max(32px,calc((100% - 60ch)/2)); }
}
@media (min-width: 1000px) {
  .app-shell { display: grid; grid-template-columns: 186px minmax(0,1fr); grid-template-rows: auto 1fr; gap: 0 32px; }
  .app-header { grid-column: 1/-1; border-bottom: 1px solid var(--line); margin-bottom: 18px; }
  .app-shell main { grid-column: 2; grid-row: 2; min-width: 0; }
  .mobile-nav { grid-column: 1; grid-row: 2; align-self: start; position: sticky; top: 20px; left: auto; bottom: auto; transform: none; width: 100%; box-sizing: border-box; flex-direction: column; align-items: stretch; border-radius: 24px; padding: 10px; }
  .mobile-nav button, .mobile-nav button.nav-magic { display: flex; flex-direction: row; justify-content: flex-start; align-items: center; gap: 12px; border-radius: 14px; padding: 11px 14px; margin: 0; min-height: 46px; flex: none; font-size: 15px; }
  .mobile-nav .nav-magic span { position: static; width: auto; height: auto; clip-path: none; }
  .mobile-nav button.active { background: #eaf1e6; }
  .mobile-nav button.active:after { display: none; }
  .app-footer { padding-bottom: 48px; }
  .reader[open] { display: grid; grid-template-columns: 36% minmax(0,1fr); grid-template-rows: auto 1fr; width: min(1120px,94vw); }
  .reader-top { grid-column: 1/-1; grid-row: 1; margin: 0; background: var(--reader-bg); }
  .reader-scene { grid-column: 1; grid-row: 2; position: sticky; top: 80px; height: auto; aspect-ratio: 1; align-self: start; margin: 16px; border-radius: 24px; }
  .reader-scene .art { width: 100%; height: 100%; }
  .reading { grid-column: 2; grid-row: 2; margin: 0; padding: 16px 32px 38px 14px; }
}
@media (min-width: 1200px) { .story-grid { grid-template-columns: repeat(4,minmax(0,1fr)); } }
