/* The same riso inks as the house, mixed into coloured window frames. */
.house .door[data-theme-color]:not(.door-entrance) .door-surface {
  background: var(--theme-color);
  border: 5px solid var(--theme-color);
  box-shadow: inset 0 0 0 1px #071e2280;
}
.house .door[data-theme-color]:not(.door-entrance) .door-surface::before {
  content: ''; position: absolute; inset: 0; z-index: 2; pointer-events: none;
  background: var(--theme-color); opacity: .16; mix-blend-mode: screen;
}
.house .door[data-theme-color]:not(.door-entrance) .door-surface::after {
  inset: 0; opacity: 1;
  background-image: var(--theme-bands), radial-gradient(#071e2226 .55px, transparent .8px);
  background-position: bottom, 0 0;
  background-size: 100% 5px, 3px 3px;
  background-repeat: no-repeat, repeat;
}
.house .door[data-theme-color]:not(.door-entrance) .door-number {
  background: var(--theme-color); color: var(--theme-ink);
  border-color: #071e22; box-shadow: 2px 2px 0 #071e22;
}
.house .door-entrance[data-theme-color] .entrance-number { background: var(--theme-color); color: var(--theme-ink); }
.door-themes { display: flex; flex-wrap: wrap; gap: .4rem; margin: .6rem 0 1rem; }
.door-theme {
  display: inline-block; padding: .2rem .55rem; border: 1px solid #071e22;
  background: var(--theme-color); color: var(--theme-ink);
  font-size: .8rem; line-height: 1.5; box-shadow: 2px 2px 0 #071e2233;
}
.door-book { margin: 1rem 0 1.2rem; padding-left: .8rem; border-left: 3px solid #1d7874; }
.door-book span, .door-book strong { display: block; }
.door-book strong { font-size: 1rem; }
.door-book .author { margin-top: .25rem; }
.door-music { margin: 1.4rem 0 .6rem; }
.door-track-title { font-size: 1.05rem; margin: 0 0 .25rem; }
.door-performer { margin: 0 0 .8rem; font-size: .9rem; }
.apple-music-player { display: block; width: 100%; max-width: 660px; border: 0; border-radius: 10px; margin-top: 1rem; background: #fff0da; }
@media(max-width:700px) {
  .house .door[data-theme-color]:not(.door-entrance) .door-surface { border-width: 3px; }
  .house .door[data-theme-color]:not(.door-entrance) .door-surface::after { background-size: 100% 4px, 3px 3px; }
}

.door-body { max-width: 68ch; margin: 1.5rem auto; font-size: 1rem; line-height: 1.8; overflow-wrap: anywhere; }
.modal-grid.modal-grid-wide { grid-template-columns: minmax(0, 1fr); }
.modal-grid-wide .modal-art { width: 100%; }
.modal-grid-wide .modal-illustration { max-height: none; height: auto; }
.door-image-hint { display: block; font-size: .875rem; margin: .6rem 0 1rem; text-decoration: underline; text-underline-offset: .2em; }
.door-image-zoom { display: block; color: inherit; cursor: zoom-in; text-decoration: none; }
.door-image-zoom:focus-visible { outline: 3px solid #071e22; outline-offset: 4px; }
.door-body .door-paragraph { margin: 0 0 1.2em; }
#book-modal .door-body a {
  color: #134a46; text-decoration: underline; text-decoration-thickness: .09em;
  text-underline-offset: .2em; text-decoration-skip-ink: auto;
}
#book-modal .door-body a:hover { text-decoration-thickness: .16em; }
.door-body .door-quote { font-style: italic; font-weight: 600; }

.door-close-area { display: flex; justify-content: center; margin: 2rem 0 .5rem; padding-top: 1.5rem; border-top: 1px solid #071e2240; }
.door-close-bottom {
  position: relative; isolation: isolate; overflow: hidden;
  display: inline-flex; align-items: center; justify-content: center; gap: .65rem;
  box-sizing: border-box; width: min(100%, 320px); min-height: 68px;
  padding: .8rem 1rem; border: 2px solid #071e22; border-left: 8px solid #ee2e31;
  color: #fff0da; background: #1d7874; box-shadow: 5px 5px 0 #071e22;
  font: inherit; font-size: 1rem; font-weight: 700; cursor: pointer;
  transition: transform .2s, box-shadow .2s;
}
.door-close-bottom::before {
  content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(#071e2250 .65px, transparent .85px) 0 0 / 3px 3px;
}
.door-close-bottom::after {
  content: ''; position: absolute; inset: -80% -40%; pointer-events: none;
  background: linear-gradient(115deg, transparent 38%, #f4c0950d 44%, #fff0da8c 49%, #f4c09526 53%, transparent 59%);
  transform: translateX(-80%); animation: door-button-glimmer 6s ease-in-out infinite;
}
.door-close-symbol { flex: 0 0 34px; width: 34px; height: 34px; }
.door-close-star { color: #f4c095; font-size: 1.4rem; animation: door-button-star 6s ease-in-out infinite; }
.door-close-bottom:hover { transform: translate(-1px, -2px); box-shadow: 6px 7px 0 #071e22; }
.door-close-bottom:active { transform: translate(3px, 3px); box-shadow: 2px 2px 0 #071e22; }
.door-close-bottom:focus-visible { outline: 3px solid #071e22; outline-offset: 6px; }
#book-modal.closing { pointer-events: none; animation: door-fold-away .36s cubic-bezier(.4, 0, .7, 1) both; transform-origin: 50% 85%; }
#book-modal.closing::backdrop { animation: door-backdrop-away .36s ease-in both; }
.house .door.homecoming .door-number { animation: door-homecoming .9s ease-out both; }
@keyframes door-button-glimmer { 0%, 62% { transform: translateX(-80%); opacity: 0; } 66% { opacity: 1; } 87%, 100% { transform: translateX(80%); opacity: 0; } }
@keyframes door-button-star { 0%, 60%, 100% { opacity: .7; transform: scale(.85) rotate(-8deg); } 74% { opacity: 1; transform: scale(1.13) rotate(12deg); } }
@keyframes door-fold-away { to { opacity: 0; transform: translateY(22px) scale(.94) rotate(-.65deg); } }
@keyframes door-backdrop-away { to { opacity: 0; } }
@keyframes door-homecoming { 0%, 30% { box-shadow: 0 0 0 4px #f4c095, 4px 4px 0 #ee2e31, 0 0 22px #f4c095aa; } 100% { box-shadow: 2px 2px 0 #071e22; } }
@media(prefers-reduced-motion: reduce) {
  .door-close-bottom, .door-close-bottom::after, .door-close-star, #book-modal.closing,
  #book-modal.closing::backdrop, .house .door.homecoming .door-number { animation: none !important; transition: none !important; }
  .door-close-bottom:hover, .door-close-bottom:active { transform: none; }
}
/* Decorative print layers can extend a couple of pixels; reading scrolls vertically. */
#book-modal { overflow-x: hidden; }
