:root {
  --bg-top: #9fdcff;
  --bg-mid: #73cfe3;
  --bg-bottom: #0f6f8d;
  --panel-border: rgba(96, 150, 172, 0.24);
  --text-main: #f8fdff;
  --text-sub: rgba(238, 248, 252, 0.84);
  --text-soft: rgba(223, 241, 247, 0.74);
  --accent-soft: rgba(235, 248, 252, 0.24);
}

* {
  box-sizing: border-box;
}

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

body {
  overflow: hidden;
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  color: var(--text-main);
  background:
    radial-gradient(circle at 22% 14%, rgba(255, 249, 227, 0.75), transparent 17%),
    radial-gradient(circle at 74% 18%, rgba(196, 241, 252, 0.40), transparent 24%),
    radial-gradient(circle at 50% 46%, rgba(154, 230, 238, 0.22), transparent 36%),
    linear-gradient(180deg, var(--bg-top) 0%, var(--bg-mid) 42%, var(--bg-bottom) 100%);
}

body::before,
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
}

body::before {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0) 24%),
    radial-gradient(circle at 48% 58%, rgba(121, 222, 232, 0.22), transparent 46%),
    radial-gradient(circle at 18% 78%, rgba(255, 255, 255, 0.12), transparent 28%);
  mix-blend-mode: screen;
  opacity: 0.9;
}

body::after {
  background:
    radial-gradient(circle at 50% 58%, rgba(255, 255, 255, 0.08), transparent 54%),
    linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(13, 72, 98, 0.22) 72%, rgba(8, 56, 79, 0.34) 100%);
}

.scene {
  position: relative;
  width: 100%;
  height: 100%;
  isolation: isolate;
}

canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.hero-copy {
  position: absolute;
  left: clamp(20px, 4vw, 52px);
  top: clamp(20px, 4vw, 46px);
  width: min(460px, calc(100vw - 40px));
  padding: 22px 22px 20px;
  border: 1px solid var(--panel-border);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(17, 68, 93, 0.54), rgba(7, 45, 65, 0.34));
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow:
    0 22px 54px rgba(18, 74, 101, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.16);
  z-index: 2;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--text-sub);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.08em;
}

.eyebrow::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(163, 213, 225, 0.9);
  box-shadow: 0 0 18px rgba(163, 213, 225, 0.18);
}

.hero-media {
  width: clamp(180px, 48%, 236px);
  margin: 16px 0 14px;
}

.hero-media img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  object-fit: contain;
  border-radius: 16px;
}

.lead {
  margin: 0;
  color: var(--text-sub);
  font-size: clamp(15px, 2vw, 18px);
  line-height: 1.65;
  max-width: 34ch;
}

.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;
}

.blessing-compose {
  margin-top: 18px;
  padding: 16px 16px 14px;
  border: 1px solid rgba(222, 245, 250, 0.18);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(235, 250, 252, 0.12), rgba(22, 97, 126, 0.16));
}

.blessing-compose-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.compose-kicker {
  margin: 0 0 4px;
  color: rgba(241, 251, 255, 0.78);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.blessing-compose h2 {
  margin: 0;
  color: var(--text-main);
  font-size: 18px;
  line-height: 1.2;
}

.compose-count {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(244, 252, 255, 0.18);
  color: rgba(247, 252, 255, 0.84);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.05em;
}

.compose-auth-status {
  margin: 12px 0 0;
  color: var(--text-sub);
  font-size: 13px;
  line-height: 1.55;
}

.compose-auth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.compose-form {
  margin-top: 14px;
}

.compose-form textarea {
  width: 100%;
  min-height: 106px;
  padding: 13px 14px;
  border: 1px solid rgba(225, 246, 250, 0.22);
  border-radius: 14px;
  background: rgba(235, 250, 252, 0.16);
  color: var(--text-main);
  font: inherit;
  line-height: 1.65;
  resize: vertical;
  outline: none;
  transition: border-color 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

.compose-form textarea::placeholder {
  color: rgba(233, 246, 250, 0.60);
}

.compose-form textarea:focus {
  border-color: rgba(245, 252, 255, 0.46);
  background: rgba(243, 252, 255, 0.20);
  box-shadow: 0 0 0 3px rgba(245, 252, 255, 0.12);
}

.compose-form textarea:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.compose-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
}

.compose-meta {
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.5;
}

.compose-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(225, 246, 250, 0.22);
  border-radius: 999px;
  background: rgba(243, 252, 255, 0.18);
  color: var(--text-main);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  transition: transform 180ms ease, background-color 180ms ease, border-color 180ms ease, opacity 180ms ease;
}

.compose-button:hover {
  transform: translateY(-1px);
  background: rgba(247, 253, 255, 0.24);
  border-color: rgba(240, 251, 255, 0.34);
}

.compose-button.secondary {
  background: rgba(21, 89, 115, 0.18);
}

.compose-button.submit {
  background: rgba(246, 252, 255, 0.26);
}

.compose-button:disabled {
  opacity: 0.56;
  cursor: not-allowed;
  transform: none;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.meta span {
  display: inline-flex;
  align-items: center;
  padding: 9px 12px;
  border-radius: 999px;
  border: 1px solid rgba(211, 240, 247, 0.24);
  background: rgba(20, 86, 111, 0.28);
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.03em;
}

.hint {
  position: absolute;
  right: clamp(20px, 4vw, 48px);
  bottom: clamp(20px, 4vw, 42px);
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(212, 243, 248, 0.26);
  background: rgba(18, 86, 113, 0.34);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text-soft);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.03em;
  z-index: 2;
}

.blessing-card {
  --card-x: 0px;
  --card-y: 0px;
  position: absolute;
  top: 0;
  left: 0;
  width: min(280px, calc(100vw - 40px));
  padding: 14px 16px 15px;
  border: 1px solid rgba(190, 233, 242, 0.34);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(22, 86, 113, 0.80), rgba(11, 58, 80, 0.70));
  box-shadow:
    0 18px 38px rgba(16, 70, 95, 0.22),
    0 0 26px rgba(145, 224, 232, 0.10),
    inset 0 1px 0 rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  opacity: 0;
  transform: translate3d(var(--card-x), var(--card-y), 0) scale(0.96);
  transform-origin: 0 100%;
  transition:
    opacity 240ms ease,
    transform 280ms cubic-bezier(0.2, 0.8, 0.2, 1);
  pointer-events: none;
  z-index: 3;
}

.blessing-card::after {
  content: "";
  position: absolute;
  left: 18px;
  bottom: -9px;
  width: 18px;
  height: 18px;
  border-right: 1px solid rgba(190, 233, 242, 0.28);
  border-bottom: 1px solid rgba(190, 233, 242, 0.28);
  background: rgba(11, 58, 80, 0.78);
  transform: rotate(45deg);
}

.blessing-card.is-visible {
  opacity: 1;
  transform: translate3d(var(--card-x), var(--card-y), 0) scale(1);
}

.blessing-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(232, 247, 251, 0.20);
  color: rgba(245, 252, 255, 0.88);
  font-size: 11px;
  font-weight: 650;
  letter-spacing: 0.08em;
}

.blessing-text {
  margin: 11px 0 0;
  color: rgba(233, 242, 247, 0.92);
  font-size: 14px;
  line-height: 1.7;
}

.fallback {
  position: absolute;
  inset: auto 20px 20px auto;
  max-width: 320px;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(13, 61, 84, 0.72);
  color: rgba(239, 248, 252, 0.84);
  font-size: 13px;
  line-height: 1.55;
  z-index: 4;
  display: none;
}

@media (max-width: 740px) {
  .hero-copy {
    padding: 18px 18px 16px;
    width: min(100vw - 32px, 420px);
  }

  .hero-media {
    width: min(100%, 220px);
  }

  .lead {
    max-width: none;
  }

  .compose-footer {
    flex-direction: column;
    align-items: stretch;
  }

  .compose-button.submit {
    width: 100%;
  }

  .hint {
    left: 16px;
    right: auto;
    bottom: 16px;
  }

  .blessing-card {
    width: min(260px, calc(100vw - 32px));
  }
}

@media (prefers-reduced-motion: reduce) {
  .hint {
    display: none;
  }
}
