/* Open a world: a single still image, sized around its complete central subject. */
:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: #111111;
  background: #fae7d2;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body { overscroll-behavior: none; }
.landing {
  position: relative;
  isolation: isolate;
  width: 100%;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  background: linear-gradient(to bottom, #fbe9d6, #f7e2cb);
}
.world-art {
  position: absolute;
  z-index: -1;
  left: 50%;
  top: 53%;
  width: min(138vw, 183vh);
  width: min(138vw, 183svh);
  height: auto;
  max-width: none;
  transform: translate(-50%, -50%);
  display: block;
  pointer-events: none;
  user-select: none;
}
.headline {
  position: absolute;
  top: max(5svh, calc(env(safe-area-inset-top) + 20px));
  left: max(20px, env(safe-area-inset-left));
  right: max(20px, env(safe-area-inset-right));
  margin: 0;
  font-size: clamp(30px, calc(min(10vw, 10svh) - 4px), 96px);
  line-height: 1.08;
  font-weight: 600;
  letter-spacing: -.02em;
  text-align: center;
}
.brand {
  position: absolute;
  left: 50%;
  bottom: max(6.7svh, calc(env(safe-area-inset-bottom) + 20px));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .32em;
  margin: 0;
  font-size: clamp(22px, 3.3svh, 30px);
  line-height: 1;
  font-weight: 750;
  letter-spacing: -.04em;
  white-space: nowrap;
}
.brand-mark { display: block; flex: none; width: 1.18em; height: 1.18em; }
@media (max-height: 500px) {
  .headline {
    top: max(5svh, calc(env(safe-area-inset-top) + 12px));
    font-size: clamp(20px, calc(6svh - 2px), 28px);
  }
  .brand {
    bottom: max(5svh, calc(env(safe-area-inset-bottom) + 12px));
    font-size: clamp(18px, 5svh, 24px);
  }
}

/* On tall screens, keep every part of the book inside the viewport.
   Fade only the empty outer cream bleed where the square no longer fills it. */
@media (max-aspect-ratio: 7/10) {
  .world-art {
    -webkit-mask-image: linear-gradient(to bottom, transparent, #000 25%, #000 75%, transparent);
    mask-image: linear-gradient(to bottom, transparent, #000 25%, #000 75%, transparent);
  }
  .headline { top: max(12svh, calc(env(safe-area-inset-top) + 20px)); }
  .brand { bottom: max(10svh, calc(env(safe-area-inset-bottom) + 20px)); }
}

/* Blend the unused side bleed on ultrawide and short landscape screens.
   The complete book and ribbon remain within the fully opaque center. */
@media (min-aspect-ratio: 183/100) {
  .world-art {
    -webkit-mask-image: linear-gradient(to right, transparent, #000 16%, #000 84%, transparent);
    mask-image: linear-gradient(to right, transparent, #000 16%, #000 84%, transparent);
  }
}

/* A smaller nudge keeps the ribbon clear of the lockup on short screens. */
@media (max-height: 600px) { .world-art { top: 52%; } }

/* Progressive enhancement: the default/no-script page stays visible. */
.headline, .brand { transition: opacity 420ms ease; }
.art-loading .headline, .art-loading .brand { opacity: 0; }
@media (prefers-reduced-motion: reduce) {
  .headline, .brand { transition: none; }
}
