:root {
  --paper: #ffffff;
  --ink: #111111;
  --ink-soft: #6b6b6b;
  --shadow: #111111;
  --bubbly: "Fredoka", system-ui, sans-serif;
  --hand: "Gloria Hallelujah", "Comic Sans MS", cursive;
  --bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html, body {
  height: 100%;
  overflow: hidden;
}

body {
  background: var(--paper);
  background-image: radial-gradient(rgba(17, 17, 17, 0.06) 1.4px, transparent 1.4px);
  background-size: 22px 22px;
  color: var(--ink);
  font-family: var(--bubbly);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  display: grid;
  place-items: center;
  cursor: default;
}

::selection { background: var(--ink); color: var(--paper); }
a { color: inherit; text-decoration: none; }

.splash {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: var(--paper);
  display: grid;
  place-items: center;
  gap: 0.4rem;
  grid-auto-flow: row;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
.splash.is-gone { opacity: 0; visibility: hidden; }
.splash__heart {
  font-size: 3.4rem;
  line-height: 1;
  animation: beat 0.8s var(--bounce) infinite;
}
.splash__text {
  font-family: var(--hand);
  font-size: 0.85rem;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
}
.splash__text span {
  display: inline-block;
  animation: dot 1.2s ease-in-out infinite;
}
.splash__text span:nth-child(2) { animation-delay: 0.15s; }
.splash__text span:nth-child(3) { animation-delay: 0.3s; }
@keyframes beat {
  0%, 100% { transform: scale(1) rotate(-4deg); }
  50% { transform: scale(1.25) rotate(4deg); }
}
@keyframes dot {
  0%, 100% { opacity: 0.2; }
  50% { opacity: 1; }
}

.doodles {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.doodle {
  position: absolute;
  color: var(--ink);
  opacity: 0.16;
  font-size: 1.6rem;
  animation: bob 6s ease-in-out infinite, spin 14s linear infinite;
}
.doodle:nth-child(1)  { top: 12%; left: 9%;  font-size: 2.4rem; }
.doodle:nth-child(2)  { top: 22%; left: 82%; font-size: 1.9rem; animation-delay: -1s; }
.doodle:nth-child(3)  { top: 70%; left: 6%;  font-size: 2.1rem; animation-delay: -2.5s; }
.doodle:nth-child(4)  { top: 84%; left: 78%; animation-delay: -0.6s; }
.doodle:nth-child(5)  { top: 8%;  left: 64%; font-size: 1.4rem; animation-delay: -3s; }
.doodle:nth-child(6)  { top: 46%; left: 90%; font-size: 2.6rem; animation-delay: -1.8s; }
.doodle:nth-child(7)  { top: 90%; left: 40%; font-size: 1.3rem; animation-delay: -2s; }
.doodle:nth-child(8)  { top: 35%; left: 3%;  font-size: 1.7rem; animation-delay: -4s; }
.doodle:nth-child(9)  { top: 58%; left: 95%; font-size: 1.6rem; animation-delay: -1.2s; }
.doodle:nth-child(10) { top: 16%; left: 30%; font-size: 1.3rem; animation-delay: -3.4s; }
.doodle:nth-child(11) { top: 76%; left: 60%; font-size: 1.9rem; animation-delay: -0.3s; }
.doodle:nth-child(12) { top: 4%;  left: 47%; font-size: 1.5rem; animation-delay: -2.8s; }

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.card {
  position: relative;
  z-index: 2;
  width: min(92vw, 420px);
  height: 100dvh;
  padding: clamp(0.5rem, 1.6vh, 1.1rem) clamp(0.5rem, 2vw, 1.1rem);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(0.26rem, 0.7vh, 0.6rem);
}

body:not(.is-ready) .me,
body:not(.is-ready) .name,
body:not(.is-ready) .bio,
body:not(.is-ready) .verify,
body:not(.is-ready) .btn,
body:not(.is-ready) .footnote {
  opacity: 0;
}
.is-ready .me       { animation: pop 0.6s var(--bounce) 0.05s backwards; }
.is-ready .name     { animation: pop 0.6s var(--bounce) 0.16s backwards; }
.is-ready .bio      { animation: pop 0.6s var(--bounce) 0.24s backwards; }
.is-ready .verify   { animation: pop 0.6s var(--bounce) 0.3s backwards; }
.is-ready .btn      { animation: pop 0.55s var(--bounce) calc(0.4s + var(--i) * 0.08s) backwards; }
.is-ready .footnote { animation: pop 0.55s var(--bounce) 0.9s backwards; }
@keyframes pop {
  from { opacity: 0; transform: translateY(16px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.me {
  position: relative;
  width: clamp(92px, 15vh, 132px);
  margin-top: 0.5rem;
}
.me__bow {
  position: absolute;
  top: -16%;
  left: 50%;
  width: 56%;
  transform: translateX(-50%) rotate(-3deg);
  fill: var(--paper);
  stroke: var(--ink);
  stroke-width: 3;
  stroke-linejoin: round;
  z-index: 3;
  filter: drop-shadow(2px 2px 0 var(--shadow));
}
.me__ring {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 50%;
  border: 3.5px solid var(--ink);
  background: #eee;
  overflow: hidden;
  box-shadow: 4px 4px 0 var(--shadow);
  animation: floaty 4.5s ease-in-out infinite;
}
.me__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 25%;
  filter: grayscale(1) contrast(1.05);
  opacity: 0;
  transition: opacity 0.6s ease;
}
.me__img.is-loaded { opacity: 1; }
.me__placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  font-family: var(--hand);
  font-size: 0.8rem;
  line-height: 1.4;
  color: var(--ink-soft);
}
.me__placeholder small { font-size: 0.6rem; opacity: 0.7; }
.me__ring.has-img .me__placeholder { display: none; }

.me__sticker {
  position: absolute;
  right: -10px;
  bottom: 4px;
  z-index: 4;
  font-family: var(--hand);
  font-size: 0.8rem;
  background: var(--ink);
  color: var(--paper);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  transform: rotate(8deg);
  box-shadow: 2px 2px 0 rgba(17,17,17,0.25);
}
@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(-1.5deg); }
  50% { transform: translateY(-7px) rotate(1.5deg); }
}

.name {
  font-weight: 700;
  font-size: clamp(1.8rem, 7vw, 2.6rem);
  letter-spacing: -0.01em;
  line-height: 1;
}
.name__spark {
  display: inline-block;
  animation: twinkle 1.6s ease-in-out infinite;
}
@keyframes twinkle {
  0%, 100% { transform: scale(1) rotate(0); opacity: 1; }
  50% { transform: scale(0.6) rotate(20deg); opacity: 0.5; }
}
.bio {
  font-family: var(--hand);
  font-size: clamp(0.72rem, 1.6vw, 0.85rem);
  line-height: 1.6;
  color: var(--ink-soft);
}
.bio .kao { color: var(--ink); white-space: nowrap; }

.verify {
  max-width: 32ch;
  margin: 0 auto;
  font-family: var(--bubbly);
  font-weight: 400;
  font-size: 0.58rem;
  line-height: 1.45;
  letter-spacing: 0.01em;
  color: var(--ink-soft);
}
.verify b {
  font-weight: 600;
  color: var(--ink);
}

.links {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: clamp(0.3rem, 0.75vh, 0.5rem);
  margin-top: 0.1rem;
}
.btn {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: clamp(0.32rem, 0.8vh, 0.5rem) 0.9rem;
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 999px;
  box-shadow: 4px 4px 0 var(--shadow);
  transition: transform 0.16s var(--bounce), box-shadow 0.16s var(--bounce), background 0.16s ease, color 0.16s ease;
  cursor: pointer;
}
.btn:hover, .btn:focus-visible {
  outline: none;
  transform: translate(-2px, -2px) rotate(-1.4deg);
  box-shadow: 7px 7px 0 var(--shadow);
}
.btn:active { transform: translate(2px, 2px) rotate(0); box-shadow: 1px 1px 0 var(--shadow); }
.btn:focus-visible { background: var(--ink); color: var(--paper); }

@keyframes ico-wiggle {
  0%, 100% { transform: rotate(0); }
  35% { transform: rotate(-12deg); }
  65% { transform: rotate(9deg); }
}
.btn:hover .btn__ico, .btn:focus-visible .btn__ico {
  animation: ico-wiggle 0.45s ease-in-out;
}

.btn__ico {
  flex: none;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2.5px solid var(--ink);
  background: var(--ink);
}
.btn__ico svg {
  width: 15px; height: 15px;
  fill: none;
  stroke: var(--paper);
  stroke-width: 1.9;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.btn__txt {
  flex: 1;
  text-align: left;
  line-height: 1.05;
  min-width: 0;
}
.btn__txt b {
  display: block;
  font-weight: 600;
  font-size: clamp(0.9rem, 2.2vw, 1.04rem);
}
.btn__txt b em {
  font-style: normal;
  font-weight: 500;
  font-size: 0.68em;
  color: var(--ink-soft);
}
.btn:focus-visible .btn__txt b em { color: rgba(255,255,255,0.7); }
.btn__txt i {
  font-style: normal;
  font-family: var(--hand);
  font-size: 0.66rem;
  color: var(--ink-soft);
}
.btn:focus-visible .btn__txt i { color: rgba(255,255,255,0.8); }
.btn__tail {
  flex: none;
  font-size: 1.05rem;
  transform: scale(0.8);
  opacity: 0.35;
  transition: transform 0.25s var(--bounce), opacity 0.25s ease;
}
.btn:hover .btn__tail, .btn:focus-visible .btn__tail {
  transform: scale(1.3) rotate(15deg);
  opacity: 1;
}

.footnote {
  font-family: var(--hand);
  font-size: 0.68rem;
  color: var(--ink-soft);
  margin-top: 0.1rem;
}
.footnote .kao { color: var(--ink); }

.throne-wrap {
  position: relative;
  width: 100%;
}
.spoil-trigger {
  position: absolute;
  top: -13px;
  right: 16px;
  z-index: 5;
  font-family: var(--hand);
  font-size: 0.62rem;
  color: var(--paper);
  background: var(--ink);
  border: 2px solid var(--ink);
  padding: 0.16rem 0.55rem;
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 2px 2px 0 rgba(17, 17, 17, 0.25);
  animation: nudge 1.7s ease-in-out infinite;
}
.spoil-trigger::after {
  content: "";
  position: absolute;
  left: 16px;
  bottom: -4px;
  width: 8px;
  height: 8px;
  background: var(--ink);
  transform: rotate(45deg);
}
.spoil-trigger:hover, .spoil-trigger:focus-visible {
  outline: none;
  transform: scale(1.08) rotate(2deg);
}
@keyframes nudge {
  0%, 100% { transform: translateY(0) rotate(-4deg); }
  50% { transform: translateY(-3px) rotate(-4deg); }
}

.spoil-pop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 1.2rem;
  background: rgba(17, 17, 17, 0.42);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.spoil-pop.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.spoil-pop__card {
  position: relative;
  width: min(90vw, 360px);
  background: var(--paper);
  border: 3px solid var(--ink);
  border-radius: 24px;
  box-shadow: 6px 6px 0 var(--shadow);
  padding: 1.5rem 1.25rem 1.3rem;
  text-align: center;
  transform: translateY(12px) scale(0.94);
  transition: transform 0.3s var(--bounce);
}
.spoil-pop.is-open .spoil-pop__card { transform: translateY(0) scale(1); }
.spoil-pop__close {
  position: absolute;
  top: -14px;
  right: -14px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--paper);
  border: 2.5px solid var(--paper);
  border-radius: 50%;
  font-size: 0.78rem;
  cursor: pointer;
  box-shadow: 2px 2px 0 rgba(17, 17, 17, 0.3);
  transition: transform 0.16s var(--bounce);
}
.spoil-pop__close:hover, .spoil-pop__close:focus-visible {
  outline: none;
  transform: rotate(90deg) scale(1.1);
}
.spoil-pop__title {
  font-family: var(--bubbly);
  font-weight: 700;
  font-size: 1.15rem;
  line-height: 1.25;
  margin-bottom: 0.9rem;
}
.spoil-pop__title span {
  display: inline-block;
  animation: twinkle 1.6s ease-in-out infinite;
}
.spoil-pop__list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  text-align: left;
}
.spoil-pop__list li {
  position: relative;
  padding-left: 1.3rem;
  font-family: var(--hand);
  font-size: 0.78rem;
  line-height: 1.5;
  color: var(--ink-soft);
}
.spoil-pop__list li::before {
  content: "♡";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--ink);
}

.sparkle {
  position: fixed;
  z-index: 80;
  pointer-events: none;
  font-size: 1rem;
  color: var(--ink);
  will-change: transform, opacity;
  animation: sparkle-fade 0.7s ease-out forwards;
}
@keyframes sparkle-fade {
  0% { transform: translate(-50%, -50%) scale(0.3) rotate(0); opacity: 1; }
  100% { transform: translate(-50%, -140%) scale(1.1) rotate(40deg); opacity: 0; }
}

@media (max-height: 730px) {
  .footnote { display: none; }
}
@media (max-height: 640px) {
  .me { width: clamp(72px, 13vh, 96px); }
  .bio { font-size: 0.68rem; }
  .bio br { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .doodle, .me__ring, .name__spark, .splash__heart, .spoil-trigger, .spoil-pop__title span { animation: none; }
  .me, .name, .bio, .verify, .btn, .footnote { opacity: 1; transform: none; animation: none; }
  .btn:hover .btn__ico, .btn:focus-visible .btn__ico { animation: none; }
  .spoil-pop, .spoil-pop__card { transition: none; }
  .sparkle { display: none; }
}
