#house-entry {
 --forest: #244936;
 --gold: #a97e3f;
 --paper: #f9efd9;
 display: grid;
 place-items: center;
 position: fixed;
 inset: 0;
 z-index: 9;
 overflow: auto;
 overscroll-behavior: contain;
 padding: clamp(18px, 5vw, 66px);
}
#house-entry::before {
 content: '';
 position: fixed;
 inset: 0;
 z-index: -1;
 background-color: #234637;
 background-image: radial-gradient(ellipse at 45% 26%, transparent 15%, #08271e80 100%),
  repeating-linear-gradient(0deg, #faf4c206 0 1px, transparent 1px 3px),
  repeating-linear-gradient(90deg, #071e1c18 0 1px, transparent 1px 3px);
}
.entry-book {
 position: relative;
 isolation: isolate;
 display: grid;
 grid-template-columns: repeat(2, minmax(0, 1fr));
 width: min(100%, 1120px, 156vh);
 width: min(100%, 1120px, 156svh);
 aspect-ratio: 1.74;
 perspective: 1600px;
 box-shadow: 0 32px 60px -22px #06160eb3;
}
.entry-book::before {
 content: '';
 position: absolute;
 z-index: -1;
 inset: -6px -7px -8px;
 border: 1px solid #937c4c;
 border-radius: 6px;
 background: #46604b;
 box-shadow: inset 0 0 0 2px #2c493a, 0 2px 0 #152d22;
}
.entry-leaf {
 display: grid;
 place-items: center;
 position: relative;
 min-width: 0;
 background-color: var(--paper);
 border-block: 1px solid #ddcba8;
}
.entry-leaf::before {
 content: '';
 position: absolute;
 inset: clamp(10px, 1.6vw, 21px);
 border: 1px solid #b89a5a6e;
 pointer-events: none;
}
.entry-title-page {
 color: var(--forest);
 border-radius: 3px 0 0 3px;
 background-image: linear-gradient(90deg, #fff9e51a 75%, #bb9a6626 97%, #80613e58);
 box-shadow: -1px 2px 0 #cdbb96, -2px 3px 0 #f0e2c3, -3px 4px 0 #b7a47d;
 transform-origin: left center;
}
.entry-art-page {
 border-radius: 0 3px 3px 0;
 background-image: linear-gradient(90deg, #a78a623d, #fffcf014 8%, transparent 85%, #c9ad7821);
 box-shadow: 1px 2px 0 #cdbb96, 2px 3px 0 #f0e2c3, 3px 4px 0 #b7a47d;
 transform-origin: right center;
}
.entry-art-page::after {
 content: '';
 position: absolute;
 top: -1px;
 right: 14%;
 width: clamp(12px, 1.65vw, 22px);
 height: clamp(32px, 4.8vw, 56px);
 background: linear-gradient(90deg,#943f30,#b05a43 25% 74%,#974431);
 clip-path: polygon(0 0,100% 0,100% 100%,50% 82%,0 100%);
}
.entry-invitation {
 position: relative;
 display: grid;
 justify-items: center;
 gap: clamp(18px, 3.4vh, 38px);
 padding: 23px 12px;
 text-align: center;
}
.entry-ornament {
 display: flex;
 align-items: center;
 gap: 10px;
 color: var(--gold);
 line-height: 1;
 font-size: clamp(16px, 2vw, 23px);
}
.entry-ornament::before, .entry-ornament::after {
 content: '';
 width: clamp(26px, 4vw, 48px);
 height: 1px;
 background: var(--gold);
}
#entry-title {
 display: grid;
 justify-items: center;
 gap: .08em;
 margin: 0;
 font: 500 clamp(42px, min(7.4vw, 12vh), 102px)/.87 Baskerville, Georgia, serif;
 letter-spacing: -.055em;
}
#entry-title small {
 font-size: .38em;
 font-weight: 400;
 font-style: italic;
 letter-spacing: -.02em;
 line-height: 1.05;
}
#entry-title em {
 color: #93503a;
 font-size: .86em;
 font-weight: 400;
 letter-spacing: -.055em;
}
#enter-house {
 display: inline-flex;
 align-items: center;
 gap: 18px;
 min-height: 47px;
 margin-top: .55em;
 padding: 5px 6px 5px 23px;
 border: 1px solid #203f30;
 border-radius: 32px;
 background: var(--forest);
 color: #fff3da;
 box-shadow: 0 3px 0 #153425;
 font: 600 15px DM, Arial, sans-serif;
 touch-action: manipulation;
}
.entry-arrow {
 display: grid;
 place-items: center;
 width: 33px;
 height: 33px;
 border: 1px solid #f4deab70;
 border-radius: 50%;
}
#enter-house svg {width: 16px; height: 16px}
#enter-house:hover {background: #30573e}
#enter-house:focus-visible {outline: 3px solid #af7642; outline-offset: 4px}
#enter-house:active {box-shadow: 0 1px 0 #153425}
#enter-house[aria-busy] .entry-arrow svg {display: none}
#enter-house[aria-busy] .entry-arrow::after {
 content: '…';
 font: 700 18px/1 DM, sans-serif;
}
.entry-print {
 position: relative;
 width: 84%;
 mix-blend-mode: multiply;
}
.entry-print img {display: block; width: 100%; height: auto}
.entry-spark {
 position: absolute;
 left: 32.8%;
 top: 24.5%;
 width: 2.1%;
 aspect-ratio: 1;
 background: #ffe7aa;
 clip-path: polygon(50% 0,59% 38%,100% 50%,60% 60%,50% 100%,40% 60%,0 50%,40% 40%);
}
.entry-spark:nth-of-type(2) {left: 45.8%; top: 12%; width: 1.6%}
.entry-spark:nth-of-type(3) {left: 58%; top: 19.8%; width: 1.2%}
#stage[inert] {visibility: hidden}
#house-entry[data-leaving] ~ #stage {visibility: visible}

/* On a narrow screen the illustration becomes a frontispiece above the title. */
@media (max-width: 700px) and (orientation: portrait) {
 #house-entry {padding: max(15px,env(safe-area-inset-top)) 17px max(18px,env(safe-area-inset-bottom))}
 .entry-book {width: min(100%, 500px); aspect-ratio: auto; grid-template-columns: 1fr}
 .entry-art-page {grid-row: 1; padding: 20px 0 2px; transform-origin: top}
 .entry-title-page {padding: 5px 0 26px; transform-origin: bottom}
 .entry-leaf {background-image: none; border: 0; border-radius: 0; box-shadow: none}
 .entry-art-page::before {border-bottom: 0; bottom: 0}
 .entry-title-page::before {border-top: 0; top: 0}
 .entry-art-page::after {height: 35px; width: 16px; right: 10%}
 .entry-print {width: min(77%, 34vh); width: min(77%, 34svh)}
 .entry-invitation {gap: 14px; padding: 0 6px 4px}
 .entry-ornament {font-size: 12px; gap: 7px}
 #entry-title {display: block; font-size: clamp(43px,min(12.3vw,8.7vh),66px); line-height: .99}
 #entry-title span {display: block}
 #entry-title small {font-size: .59em}
 #entry-title em {font-size: .93em}
 #enter-house {margin-top: 4px}
}
@media (max-height: 530px) and (orientation: landscape) {
 #house-entry {padding: 12px 20px}
 .entry-book {width: min(100%, 162svh); aspect-ratio: 1.82}
 .entry-invitation {gap: 10px; padding: 12px 8px}
 #entry-title {font-size: clamp(32px,12vh,60px)}
 #enter-house {min-height: 42px; margin-top: 2px}
 .entry-arrow {width: 28px; height: 28px}
}
@media (prefers-reduced-motion: no-preference) {
 .entry-book {animation: book-arrives .75s cubic-bezier(.2,.7,.2,1) both}
 #entry-title {animation: ink-arrives .8s .08s backwards}
 .entry-print {animation: ink-arrives 1s .12s backwards}
 .entry-spark {animation: warm-star 2.4s .7s ease-in-out 2 alternate both}
 .entry-spark:nth-of-type(2) {animation-delay: .3s}
 .entry-spark:nth-of-type(3) {animation-delay: .85s}
 #enter-house svg {transition: transform .2s ease}
 #enter-house:hover svg {transform: translateX(2px)}
 #house-entry[data-leaving] .entry-title-page {animation: turn-left .78s cubic-bezier(.55,0,.35,1) both}
 #house-entry[data-leaving] .entry-art-page {animation: turn-right .78s cubic-bezier(.55,0,.35,1) both}
 #house-entry[data-leaving] .entry-book::before {opacity: 0}
 #house-entry[data-leaving]::before {animation: open-cover .62s ease-in-out both}
 @keyframes open-cover {to{opacity: 0}}
 @keyframes book-arrives {from{opacity: 0; transform: translateY(12px) scale(.985)}}
 @keyframes ink-arrives {from{opacity: .35; transform: translateY(5px)}}
 @keyframes warm-star {0%,100%{transform: scale(.55); opacity: .3}50%{transform: scale(1.3); opacity: 1}}
 @keyframes turn-left {to{transform: rotateY(-84deg)}}
 @keyframes turn-right {to{transform: rotateY(84deg)}}
}
@media (prefers-reduced-motion: no-preference) and (max-width: 700px) and (orientation: portrait) {
 @keyframes turn-left {to{transform: rotateX(82deg)}}
 @keyframes turn-right {to{transform: rotateX(-82deg)}}
}
