:root {
  color-scheme: light;
  --cream: #f5f0e8;
  --ink: #51466b;
}
* { box-sizing: border-box; }
html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; }
body {
  background: var(--cream);
  font-family: "Arial Rounded MT Bold", "Trebuchet MS", Arial, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
.world {
  position: relative;
  width: 100%;
  height: 100vh;
  height: 100svh;
  overflow: hidden;
  background: radial-gradient(ellipse at 50% 48%, #fffaf1 0%, #f5f0e8 67%, #eee8df 100%);
}
.wordmark {
  position: absolute;
  z-index: 2;
  top: max(env(safe-area-inset-top), 7.5%);
  left: 0;
  width: 100%;
  text-align: center;
  pointer-events: none;
}
h1 {
  position: relative;
  display: inline-block;
  margin: 0;
  color: var(--ink);
  font-size: clamp(66px, 9.4vw, 132px);
  font-weight: 900;
  letter-spacing: -.075em;
  line-height: .95;
  text-shadow: 0 3px 0 #ffffff80;
}
.title-spark {
  position: absolute;
  width: .085em;
  height: .085em;
  border-radius: 50%;
  background: #e8b652;
  top: .17em;
  right: -.17em;
  box-shadow: 0 0 0 .035em #e8b6521a;
}
.stage {
  position: absolute;
  inset: 21% 0 1%;
  isolation: isolate;
  touch-action: none;
  cursor: grab;
  outline: none;
}
canvas { display: block; width: 100%; height: 100%; opacity: 0; touch-action: none; }
.is-dragging, .is-dragging canvas, .is-dragging .scene-action { cursor: grabbing !important; }
.stage:focus-visible {
  border-radius: 20px;
  box-shadow: inset 0 0 0 2px #77629155;
}
.is-ready canvas { opacity: 1; }
.scene-preview {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.fallback {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
/* Swap only after the first 3D render, without fading through an empty stage. */
.is-ready .fallback { visibility: hidden; }
.interactions { position: absolute; inset: 0; pointer-events: none; }
.scene-action {
  position: absolute;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  pointer-events: auto;
  cursor: pointer;
  outline: none;
}
.scene-action:focus-visible {
  outline: 3px solid #685a91;
  outline-offset: 5px;
  background: #fffaf132;
  box-shadow: 0 0 0 9px #fffaf166;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
@media (max-width: 600px) and (orientation: portrait) {
  .wordmark { top: max(env(safe-area-inset-top), 10%); }
  h1 { font-size: clamp(70px, 20vw, 110px); }
  .stage { inset: 21% 0 17%; }
}
@media (max-height: 500px) and (orientation: landscape) {
  .wordmark { top: max(env(safe-area-inset-top), 5%); }
  h1 { font-size: clamp(42px, 13vh, 66px); }
  .stage { inset: 21% 0 0; }
}
