/* The entrance owns the viewport only while its artwork is in #app. */
body:has(> #app > .title-entry) {
  overflow: hidden;
  background: #1e3027;
}
body:has(> #app > .title-entry) > .topbar,
body:has(> #app > .title-entry) > footer,
body:has(> #app > .title-entry)::before {
  display: none;
}
#app:has(> .title-entry) { min-height: 0; }
.title-entry {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
  background: #1e3027;
}
/* Fill spare space with a soft extension; never crop or stretch the main art. */
.title-entry::before {
  content: "";
  position: absolute;
  inset: -32px;
  z-index: -1;
  background: url('assets/title-screen-reading-clean.webp') center / cover no-repeat;
  filter: blur(24px) brightness(.45);
  pointer-events: none;
}
.title-entry__scene {
  position: relative;
  width: min(100vw, calc(100vh * 1672 / 941));
  width: min(100vw, calc(100dvh * 1672 / 941));
  aspect-ratio: 1672 / 941;
}
.title-entry__art {
  display: block;
  width: 100%;
  height: auto;
}
.title-entry__enter {
  position: absolute;
  left: 29.3%;
  bottom: 4.3%;
  width: 40.4%;
  height: 15.1%;
  min-height: 44px;
  border: 0;
  border-radius: 28px;
  padding: 0;
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background .18s, box-shadow .18s;
}
.title-entry__enter:hover:not(:disabled) {
  background: #fff2bf20;
  box-shadow: 0 0 24px #ffe5a966;
}
.title-entry__enter:focus-visible {
  outline: 4px solid #fff9df;
  outline-offset: 3px;
  box-shadow: 0 0 0 8px #193c2d;
}
.title-entry__enter:active:not(:disabled) { background: #794a2425; }
.title-entry__enter:disabled { cursor: progress; }
.title-entry__loading {
  position: absolute;
  inset: 13% 8%;
  display: grid;
  place-items: center;
  background: #f5d794;
  color: #392410;
  font: 700 clamp(12px, 2.6vw, 40px) Georgia, serif;
}
.title-entry__error {
  width: min(90vw, 520px);
  padding: 28px;
  border: 2px solid #b99043;
  border-radius: 16px;
  background: #fff5de;
  color: #352819;
  text-align: center;
}
.title-entry__error h2 { font-size: clamp(24px, 4vw, 34px); }
@media (prefers-reduced-motion: reduce) {
  .title-entry__enter { transition: none; }
}
@media (forced-colors: active) {
  .title-entry::before, .title-entry__art { visibility: hidden; }
  .title-entry__scene > h1 {
    clip: auto;
    width: 100%;
    height: auto;
    top: 15%;
    margin: 0;
    text-align: center;
    white-space: normal;
    font-size: clamp(22px, 4vw, 48px);
  }
  .title-entry__enter { background: ButtonFace; border: 2px solid ButtonText; color: ButtonText; }
  .title-entry__enter > .sr-only { position: static; clip: auto; width: auto; height: auto; margin: 0; }
}
