@font-face {
  font-family: "Averia Serif Libre";
  src: url("./assets/fonts/AveriaSerifLibre-Regular.ttf") format("truetype");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root {
  color-scheme: dark;
  font-family: "Averia Serif Libre", Georgia, serif;
  color: #fff;
  background: #080c10;
  --teal: #218d90;
}

* { box-sizing: border-box; }
html, body { height: 100%; overflow: hidden; }
body { margin: 0; }
::selection { background: var(--teal); color: #fff; }

.splash {
  --hero-height: min(220px, 30dvh);
  --gap: clamp(8px, 1.5dvh, 18px);
  display: grid;
  place-items: center;
  height: 100svh;
  height: 100dvh;
  padding: max(12px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  overflow: hidden;
}

.poster {
  position: relative;
  isolation: isolate;
  container-type: inline-size;
  display: grid;
  grid-template-areas: "title" "copy" "speech" "heroes";
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto minmax(0, 1fr) var(--hero-height);
  gap: var(--gap);
  width: min(100%, 1800px);
  height: 100%;
  min-height: 0;
  padding-top: clamp(12px, 5dvh, 48px);
}

.masthead { display: contents; }
.title {
  grid-area: title;
  margin: 0;
  font-size: min(22cqw, 36dvh);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -.065em;
  text-align: center;
  text-shadow: 4px 5px 0 var(--teal);
}

.basement-copy {
  grid-area: copy;
  z-index: 1;
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
  width: 88%;
  justify-self: center;
}
.basement-question {
  flex: 1;
  margin: 0 0 0 clamp(12px, 1.5cqw, 24px);
  font-size: min(clamp(22px, 3cqw, 42px), 4.2dvh);
  line-height: 1.2;
  text-align: left;
  text-wrap: balance;
  text-shadow: 1px 2px 0 var(--teal);
}
.coming-soon {
  flex-shrink: 0;
  margin: 0;
  font-size: min(clamp(24px, 3cqw, 42px), 4.5dvh);
  line-height: 1.25;
  text-align: right;
  white-space: nowrap;
}
.coming-soon mark {
  position: relative;
  isolation: isolate;
  display: inline-block;
  padding: .07em .32em;
  background: transparent;
  color: #24151e;
}
.coming-soon mark::before, .coming-soon mark::after {
  content: "";
  position: absolute;
  inset: -2% -4% -4%;
  clip-path: polygon(0 8%, 99% 0, 100% 91%, 1% 100%);
  transform: rotate(-1.5deg);
}
.coming-soon mark::before { z-index: -1; background: #f29bb8; }
.coming-soon mark::after { z-index: -2; background: var(--teal); translate: 3px 4px; }

.scene {
  --width: min(130cqw, calc(95dvh * 16 / 9));
  position: absolute;
  z-index: -1;
  width: var(--width);
  aspect-ratio: 16 / 9;
  left: calc(42% - var(--width) * .37);
  bottom: min(6dvh, 48px);
  pointer-events: none;
  mask-image: linear-gradient(transparent, #000 8%, #000 85%, transparent);
}
.inn { display: block; width: 100%; height: 100%; object-fit: contain; mix-blend-mode: lighten; }
.atmosphere { position: absolute; inset: 0; width: 100%; height: 100%; }

.hero-gathering {
  grid-area: heroes;
  position: relative;
  z-index: 2;
  width: min(100%, 420px);
  height: var(--hero-height);
  padding: 0 20px;
  justify-self: center;
}
.hero-lineup {
  display: flex;
  align-items: end;
  justify-content: center;
  gap: min(14px, 3cqw);
  height: 100%;
  margin: 0;
  padding: 0;
  list-style: none;
}
.hero {
  display: none;
  position: relative;
  flex: 0 1 calc(var(--hero-height) * .64);
  min-width: 0;
  height: 100%;
}
.hero:nth-child(-n+3) { display: block; }
.hero-gathering.has-conversation .hero { display: none; }
.hero-gathering.has-conversation .hero.is-visible { display: block; }
.hero img {
  position: absolute;
  bottom: 0;
  left: 50%;
  width: auto;
  height: 100%;
  transform: translateX(-50%);
  pointer-events: none;
  user-select: none;
}
.hero.is-speaking { z-index: 1; }

.conversation-slot {
  grid-area: speech;
  position: relative;
  min-width: 0;
  min-height: 0;
  padding-bottom: 6px;
  z-index: 2;
}
.speech-bubble {
  position: absolute;
  bottom: 6px;
  left: var(--bubble-left, 50%);
  width: min(420px, 100%);
  padding: min(12px, 2dvh) 14px;
  border: 1px solid #bdab88;
  border-radius: 18px 21px 17px 20px;
  background: #f0e6cd;
  color: #302d29;
  box-shadow: 3px 5px 0 #0004;
  animation: speech-arrives 240ms ease-out;
}
.speech-bubble::after {
  content: "";
  position: absolute;
  top: calc(100% - 8px);
  left: var(--tail-left, 50%);
  width: 17px;
  height: 17px;
  border: solid #bdab88;
  border-width: 0 1px 1px 0;
  background: #f0e6cd;
  transform: translateX(-50%) rotate(45deg);
}
.speech-speaker { display: block; margin-bottom: 4px; color: #236b6d; font-size: min(11px, 2.8dvh); letter-spacing: .08em; text-transform: uppercase; }
.speech-text { margin: 0; font-size: min(18px, 3.8dvh); line-height: 1.25; }

@keyframes speech-arrives {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .speech-bubble { animation: none; }
}

/* Keep the same composition when browser chrome leaves very little height. */
@media (max-height: 700px) {
  .basement-question { font-size: min(clamp(22px, 3cqw, 26px), 4.2dvh); }
  .coming-soon { font-size: min(clamp(24px, 3cqw, 28px), 4.5dvh); }
}
@media (max-height: 650px) {
  .title { font-size: min(22cqw, 28dvh); }
}
@media (max-height: 550px) {
  .splash { --gap: 6px; }
  .poster { padding-top: 8px; }
  .title { text-shadow: 2px 3px 0 var(--teal); }
  .basement-question, .coming-soon { font-size: min(22px, 4dvh); }
  .speech-bubble { padding: 6px 12px; }
  .speech-speaker { font-size: min(11px, 2.8dvh); }
  .speech-text { font-size: min(18px, 3.5dvh); }
}

@media (max-width: 559px) {
  .scene { --width: min(840px, 110dvh); left: calc(50% - var(--width) * .36); bottom: calc(var(--hero-height) * .65); }
  .basement-copy {
    width: 94%;
    flex-direction: column;
    gap: 12px;
  }
  .coming-soon { align-self: end; }
}

/* Tall windows give the inn the same presence as the desktop backdrop. */
@media (max-aspect-ratio: 1/1) {
  .scene {
    --width: max(130cqw, 145dvh);
    left: calc(50% - var(--width) * .38);
    bottom: calc(var(--hero-height) * .5);
  }
}

@media (max-height: 550px) and (max-width: 559px) {
  .basement-copy { gap: 6px; }
}

@media (max-height: 375px) and (max-width: 559px) {
  .splash { --gap: 4px; }
  .title { font-size: min(20cqw, 28dvh); }
  .basement-question, .coming-soon { font-size: 3.5dvh; }
  .speech-text { font-size: 3dvh; }
}

@media (min-width: 900px) {
  .hero-gathering { width: min(100%, 800px); }
  .hero:nth-child(-n+5) { display: block; }
  .hero-gathering.has-conversation .hero { display: none; }
  .hero-gathering.has-conversation .hero.is-visible { display: block; }
}

@media (max-width: 279px) and (min-height: 376px) {
  .basement-question, .coming-soon { font-size: min(18px, 3.6dvh); }
  .speech-text { font-size: min(16px, 3.5dvh); }
}

.error-page { display: flex; flex-direction: column; justify-content: center; gap: 24px; text-align: center; }
.error-page .title { font-size: min(20vw, 40dvh, 240px); text-align: center; }
.error-page .coming-soon { margin: 0; color: inherit; text-decoration: underline; text-decoration-color: #f29bb8; text-underline-offset: .2em; }
.error-page a:focus-visible { outline: 2px solid var(--teal); outline-offset: 8px; }
