@font-face {
  font-family: "ToScript";
  src: url("../fonts/to-script.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "NameKai";
  src: url("../fonts/name-kai.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #05010a;
}

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

html, body {
  width: 100%;
  height: 100%;
  background: var(--bg);
  overflow: hidden;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

#sky {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0;
  z-index: 1;
}

body.is-ready #sky {
  opacity: 1;
  transition: opacity 1.15s ease;
}

#center {
  position: fixed;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.glow {
  position: absolute;
  width: 230px;
  height: 230px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 150, 186, 0.38) 0%, rgba(255, 80, 130, 0.12) 42%, transparent 70%);
  opacity: 0;
  z-index: 0;
}

body.is-ready .glow {
  opacity: 1;
  transition: opacity 1.4s ease;
  animation: pulse-glow 4.6s ease-in-out infinite;
}

#avatar {
  position: relative;
  z-index: 1;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 18%;
  background: #1a0a12;
  border: 2px solid rgba(255, 232, 238, 0.9);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.12),
    0 0 22px 5px rgba(255, 130, 170, 0.48),
    0 0 64px 14px rgba(255, 70, 120, 0.22);
}

body.is-loading #avatar {
  animation: spin 2.4s linear infinite;
}

body.is-ready #avatar {
  animation: breathe 4.2s ease-in-out infinite;
}

.to {
  position: relative;
  z-index: 1;
  margin-top: 14px;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.22em;
  color: #ffe8ef;
  text-shadow: 0 0 14px rgba(255, 140, 180, 0.55), 0 2px 12px rgba(0, 0, 0, 0.65);
  opacity: 0;
}

.to-word {
  font-family: "ToScript", "Segoe Script", "Apple Chancery", cursive;
  font-weight: 400;
  font-size: 46px;
  letter-spacing: 0;
  line-height: 1;
  transform: translateY(0.08em);
}

.to-name {
  font-family: "NameKai", "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", serif;
  font-weight: 400;
  font-size: 24px;
  letter-spacing: 0.22em;
  line-height: 1;
  padding-left: 0.04em;
}

body.is-ready .to {
  opacity: 1;
  transition: opacity 1.25s ease 0.28s;
}

@media (max-width: 600px) {
  #avatar {
    width: 88px;
    height: 88px;
  }

  .to {
    margin-top: 10px;
  }

  .to-word {
    font-size: 38px;
  }

  .to-name {
    font-size: 20px;
  }

  .glow {
    width: 176px;
    height: 176px;
  }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes breathe {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.035); }
}

@keyframes pulse-glow {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.08); opacity: 0.72; }
}
