@font-face {
  font-family: "BUUGS SF Rounded";
  src: url("TemplateData/SF-Pro-Rounded-Semibold.otf") format("opentype");
  font-style: normal;
  font-weight: 600;
  font-display: swap;
}

:root {
  --page-bg: #f6f4ef;
  --page-bg-2: #efede7;
  --text: #101010;
  --muted: rgba(16, 16, 16, 0.7);
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  background: radial-gradient(circle at top, #fbfaf7 0%, var(--page-bg) 58%, var(--page-bg-2) 100%);
  color: var(--text);
  font-family: "BUUGS SF Rounded", "SF Pro Rounded", "Arial Rounded MT Bold", Arial, sans-serif;
}

body {
  overflow: hidden;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

#page {
  position: relative;
  width: 100%;
  height: 100%;
}

#hud-top {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}

#hud-top {
  top: calc(env(safe-area-inset-top, 0px) + 38px);
  gap: 14px;
}

#logo {
  width: min(24vw, 280px);
  max-height: 96px;
  object-fit: contain;
}

#x-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 170px;
  min-height: 42px;
  padding: 0 16px;
  border: 2px solid rgba(16, 16, 16, 0.86);
  background: rgba(255, 255, 255, 0.86);
  color: var(--text);
  text-decoration: none;
  font-size: clamp(12px, 0.95vw, 14px);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-family: "BUUGS SF Rounded", "SF Pro Rounded", "Arial Rounded MT Bold", Arial, sans-serif;
  transition: transform 120ms ease, background-color 120ms ease, color 120ms ease, border-color 120ms ease;
  pointer-events: auto;
}

#x-link:hover {
  transform: translateY(-1px);
  background: rgba(16, 16, 16, 0.92);
  border-color: rgba(16, 16, 16, 0.92);
  color: rgba(255, 255, 255, 0.98);
}

#hero-copy {
  margin: 2px 0 0;
  min-height: 28px;
  max-width: min(80vw, 620px);
  color: rgba(16, 16, 16, 0.82);
  font-family: "BUUGS SF Rounded", "SF Pro Rounded", "Arial Rounded MT Bold", Arial, sans-serif;
  font-size: clamp(15px, 1.4vw, 22px);
  font-weight: 600;
  letter-spacing: 0.1em;
  line-height: 1.15;
  text-align: center;
  text-transform: uppercase;
  transition: opacity 140ms ease, transform 140ms ease;
}

#interaction-hint {
  margin: -2px 0 0;
  color: rgba(16, 16, 16, 0.56);
  font-family: "BUUGS SF Rounded", "SF Pro Rounded", "Arial Rounded MT Bold", Arial, sans-serif;
  font-size: clamp(11px, 0.9vw, 13px);
  font-weight: 600;
  letter-spacing: 0.08em;
  line-height: 1.1;
  text-align: center;
  text-transform: uppercase;
  opacity: 0;
  transition: opacity 140ms ease;
}

#hero-copy.is-hidden {
  opacity: 0;
  transform: translateY(-4px);
}

#hero-copy.is-visible {
  opacity: 1;
  transform: translateY(0);
}

#hero-copy.is-typing::after {
  content: "";
  display: inline-block;
  width: 2px;
  height: 0.9em;
  margin-left: 0.18em;
  background: currentColor;
  vertical-align: -0.08em;
  opacity: 0.55;
  animation: buugs-hero-caret 0.85s step-end infinite;
}

#interaction-hint.is-visible {
  opacity: 1;
}

@keyframes buugs-hero-caret {
  50% {
    opacity: 0;
  }
}

#unity-shell {
  position: absolute;
  inset: 0;
}

#unity-canvas {
  position: absolute;
  inset: 0;
  width: 100vw;
  height: 100vh;
  background: transparent;
}

#loading-cover {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(251, 250, 247, 0.72);
  transition: opacity 160ms ease;
  pointer-events: none;
}

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

#loading-bar {
  width: min(240px, 56vw);
  height: 8px;
  border-radius: 999px;
  background: rgba(16, 16, 16, 0.08);
  overflow: hidden;
}

#loading-fill {
  width: 0;
  height: 100%;
  background: #111111;
  transition: width 120ms linear;
}

@media (max-width: 720px) {
  #hud-top {
    top: calc(env(safe-area-inset-top, 0px) + 20px);
    gap: 10px;
  }

  #logo {
    width: min(58vw, 240px);
    max-height: 76px;
  }

  #x-link {
    min-width: 156px;
    min-height: 36px;
    padding: 0 12px;
    font-size: 11px;
  }

  #hero-copy {
    max-width: min(88vw, 460px);
    font-size: clamp(13px, 3.2vw, 18px);
    letter-spacing: 0.08em;
  }

  #interaction-hint {
    font-size: 11px;
    letter-spacing: 0.07em;
  }
}
