:root {
  --bg: #001c3e;
  --ink: #2a231b;
  --ink-soft: #6a5d4d;
  --shadow: rgba(31, 20, 11, 0.48);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
}

body {
  font-family: 'EB Garamond', Georgia, 'Times New Roman', serif;
  color: var(--ink);
  background: var(--bg);
  background-image: none;
  background-attachment: fixed;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.stage {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.scene {
  width: min(78vw, 880px);
  aspect-ratio: 3300 / 2550;
  perspective: 1800px;
  position: relative;
  opacity: 0;
  transition: opacity 0.9s ease;
  pointer-events: none;
}

.scene.is-visible {
  opacity: 1;
  pointer-events: auto;
}

.sign-shadow {
  position: absolute;
  inset: 9% 10% -6%;
  background: var(--shadow);
  filter: blur(44px);
  z-index: 0;
  border-radius: 50%;
  transition: transform 1.1s cubic-bezier(0.22, 1, 0.36, 1),
              opacity 1.1s ease;
  pointer-events: none;
}

.sign-link {
  display: block;
  position: relative;
  width: 100%;
  height: 100%;
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  outline: none;
  overflow: visible;
  z-index: 3;
}

.sign-link:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 24px;
  border-radius: 4px;
}

.sign-fallback,
.sign-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 5%;
}

.sign-fallback {
  overflow: hidden;
  transform-style: preserve-3d;
  transition: transform 1.1s cubic-bezier(0.22, 1, 0.36, 1);
}

.sign-fallback-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.sign-fallback-face img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  user-select: none;
  -webkit-user-drag: none;
}

.sign-fallback-face--rear {
  transform: rotateY(180deg);
}

.sign-fallback-face--rear img {
  position: absolute;
  top: 50%;
  left: 50%;
  width: calc(100% * 2550 / 3300);
  height: calc(100% * 3300 / 2550);
  object-fit: contain;
  transform: translate(-50%, -50%) rotate(-90deg);
}

.sign-canvas {
  overflow: visible;
  opacity: 0;
  pointer-events: none;
  background: none;
}

.sign-canvas.has-three {
  opacity: 1;
  pointer-events: auto;
  background: none;
}

.sign-link.has-three-ready .sign-fallback {
  transition: opacity 220ms ease;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.sign-canvas canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.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 (hover: hover) {
  .sign-link:hover .sign-fallback,
  .sign-link:focus-visible .sign-fallback {
    transform: rotateY(180deg);
  }
}

@media (hover: none) {
  .sign-link[data-revealed="true"] .sign-fallback {
    transform: rotateY(180deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .sign-shadow {
    transition: none;
    opacity: 1;
  }
}

@media (max-width: 640px) {
  .scene {
    width: min(88vw, 600px);
  }
  .stage {
    padding: 1rem;
  }
}
