* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: #1a1a1a;
  background: #eef2ea;
  overflow: hidden;
}

button {
  font: inherit;
  cursor: pointer;
}

img {
  max-width: none;
}

.drag-hint {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  margin: 0;
  padding: 8px 16px;
  background: rgba(26, 26, 26, 0.85);
  color: #fff;
  font-size: 0.8rem;
  border-radius: 999px;
  z-index: 20;
  opacity: 1;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.drag-hint.is-hidden {
  opacity: 0;
}

.canvas-viewport {
  position: relative;
  inset: 0;
  overflow: hidden;
  cursor: grab;
  isolation: isolate;
  z-index: 0;
  background-color: #eef2ea;
  touch-action: none;
  user-select: none;
  width: 100%;
  height: 100vh;
  margin-top: 5rem;
  height: calc(100vh - 5rem);
  /* was: height: 100vh; */
  height: calc(100dvh - 5rem);
}

.canvas-viewport.is-dragging {
  cursor: grabbing;
}

.canvas-viewport.is-locked {
  cursor: default;
}

.canvas-viewport.is-locked .canvas-world,
.canvas-viewport.is-locked .canvas-bg {
  filter: blur(114px);
}

.canvas-world {
  position: absolute;
  top: 0;
  left: 0;
  transform-origin: 0 0;
  will-change: transform;
  transition: filter 0.5s ease;
}

.canvas-bg {
  position: absolute;
  inset: 0;
  background-image: url("../assets/bg-2.png");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0.05;
  transform: scale(1);
  will-change: transform;
  pointer-events: none;
  transition: filter 0.5s ease;
}

.content-band,
.content-band-clone {
  position: absolute;
  top: 0;
  left: 0;
}

.intro-block {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate3d(-50%, -50%, 0);
  width: min(560px, 70vw);
  text-align: center;
  pointer-events: none;
  z-index: 100;
  opacity: 1;
  transition: opacity 0.3s ease;
}

.intro-block.is-hidden {
  opacity: 0;
}

.intro-block__title,
.intro-block__copy {
  text-shadow: 0 0 16px #eef2ea, 0 0 8px #eef2ea;
}

.intro-block__title {
  font-family: "Amatic SC", "Georgia", serif;
  font-size: clamp(2.75rem, 6vw, 7rem);
  font-weight: 700;
  font-variant: small-caps;
  letter-spacing: 0.03em;
  margin: 0 0 12px;
}

.intro-block__copy {
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 1.4rem;
  line-height: 1.6;
  color: #5a5f57;
  margin: 0;
}

.intro-block__cta {
  pointer-events: auto;
  margin-top: 24px;
  border: none;
  background: #1f8a8c;
  color: #fff;
  font-size: 1.4rem;
  font-weight: 600;
  padding: 12px 28px;
  border-radius: 999px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
  transition: transform 0.15s ease, background-color 0.15s ease;
}

.intro-block__cta:hover,
.intro-block__cta:focus-visible {
  filter: brightness(0.92);
  transform: translateY(-1px);
}

.character {
  position: absolute;
  transform: translate(-50%, -50%);
  border: none;
  background: transparent;
  padding: 0;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.character img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  pointer-events: none;
}

.character:hover,
.character:focus-visible {
  transform: translate(-50%, -50%) scale(1.06);
}

.character:focus-visible {
  outline: 3px solid #1f8a8c;
  outline-offset: 4px;
}

.decoration {
  position: absolute;
  transform: translate(-50%, -50%) rotate(var(--rotate, 0deg));
  pointer-events: none;
  user-select: none;
}

.popup {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.popup[hidden] {
  display: none;
}

.popup__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 20, 20, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.popup__panel {
  position: relative;
  background: #ffffff;
  border-radius: 0;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
  max-width: 100rem;
  width: 100%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
  transform: translateY(16px) scale(0.98);
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

@media (max-width: 768px) {
  .popup__panel {
    grid-template-columns: 1fr;
    max-height: 90vh;
    overflow-y: auto;
  }
}

.popup.is-open .popup__backdrop {
  opacity: 1;
}

.popup.is-open .popup__panel {
  transform: translateY(0) scale(1);
  opacity: 1;
}

.popup__close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: #4fc3d9;
  color: #1a1a1a;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  font-size: 2.1rem;
  font-weight: 300;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.popup__close:hover,
.popup__close:focus-visible {
  filter: brightness(0.92);
}

.popup__image-wrap {
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.popup__image {
  width: 100%;
  max-width: 340px;
  opacity: 1;
  transition: opacity 0.15s ease;
}

.popup__image.is-loading {
  opacity: 0;
}

.popup__body {
  padding: 40px 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.popup__name {
  font-family: "Amatic SC", "Georgia", serif;
  font-size: 4rem;
  font-weight: 700;
  font-variant: small-caps;
  letter-spacing: 0.03em;
  margin: 0 0 8px;
}

.popup__description {
  margin: 8px 0 0;
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.6;
  color: #5a5f57;
}

.popup__share {
  align-self: flex-start;
  margin-top: 24px;
  border: 1px solid #1f8a8c;
  background: transparent;
  color: #1f8a8c;
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-weight: 600;
  font-size: 1.4rem;
  padding: 10px 24px;
  border-radius: 999px;
  transition: background-color 0.15s ease, color 0.15s ease;
}

.popup__share:hover,
.popup__share:focus-visible {
  background: #1f8a8c;
  color: #fff;
}

.loading-screen {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #eef2ea;
  opacity: 1;
  transition: opacity 0.5s ease;
}

.loading-screen.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.loading-screen__spinner {
  width: 36px;
  height: 36px;
  border: 3px solid rgba(31, 138, 140, 0.15);
  border-top-color: #1f8a8c;
  border-radius: 50%;
  animation: loading-screen-spin 0.8s linear infinite;
}

@keyframes loading-screen-spin {
  to {
    transform: rotate(360deg);
  }
}