:root {
  --bg: #06101f;
  --navy: #0a1630;
  --ink-night: #040814;
  --kakao: #fee500;
  --ink: #191919;
  --gold: #f5d76e;
  --gold-deep: #b8860b;
  --bow: #c41e3a;
  --moon: #eef4ff;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  min-height: 100%;
  min-height: 100dvh;
  background: var(--bg);
  color: #fff;
  font-family: "Noto Sans KR", "Apple SD Gothic Neo", sans-serif;
  overflow-x: hidden;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  display: flex;
  justify-content: center;
  overscroll-behavior: none;
  background-color: var(--ink-night);
}

.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.sky {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 70% 12%, rgba(180, 210, 255, 0.16), transparent 55%),
    radial-gradient(ellipse 60% 40% at 20% 8%, rgba(80, 110, 180, 0.18), transparent 60%);
}

.stars {
  position: absolute;
  inset: 0;
}

.stars-a {
  background-image:
    radial-gradient(1.2px 1.2px at 8% 12%, #fff, transparent),
    radial-gradient(1px 1px at 18% 28%, rgba(255, 255, 255, 0.85), transparent),
    radial-gradient(1.4px 1.4px at 27% 8%, #fff, transparent),
    radial-gradient(1px 1px at 36% 42%, rgba(245, 215, 110, 0.9), transparent),
    radial-gradient(1.2px 1.2px at 48% 16%, #fff, transparent),
    radial-gradient(1px 1px at 62% 6%, rgba(255, 255, 255, 0.8), transparent),
    radial-gradient(1.6px 1.6px at 74% 22%, #fff, transparent),
    radial-gradient(1px 1px at 86% 14%, rgba(245, 215, 110, 0.75), transparent),
    radial-gradient(1.2px 1.2px at 92% 38%, #fff, transparent),
    radial-gradient(1px 1px at 12% 58%, rgba(255, 255, 255, 0.7), transparent),
    radial-gradient(1.3px 1.3px at 41% 64%, #fff, transparent),
    radial-gradient(1px 1px at 69% 52%, rgba(255, 255, 255, 0.8), transparent),
    radial-gradient(1.2px 1.2px at 83% 68%, #fff, transparent),
    radial-gradient(1px 1px at 23% 78%, rgba(245, 215, 110, 0.7), transparent),
    radial-gradient(1.4px 1.4px at 55% 82%, #fff, transparent),
    radial-gradient(1px 1px at 94% 76%, rgba(255, 255, 255, 0.75), transparent);
  animation: twinkle 3.6s ease-in-out infinite;
}

.stars-b {
  background-image:
    radial-gradient(1px 1px at 14% 18%, rgba(255, 255, 255, 0.6), transparent),
    radial-gradient(1.5px 1.5px at 32% 34%, #fff, transparent),
    radial-gradient(1px 1px at 58% 28%, rgba(255, 255, 255, 0.7), transparent),
    radial-gradient(1.2px 1.2px at 78% 44%, #fff, transparent),
    radial-gradient(1px 1px at 6% 72%, rgba(245, 215, 110, 0.65), transparent),
    radial-gradient(1.3px 1.3px at 47% 48%, #fff, transparent),
    radial-gradient(1px 1px at 88% 88%, rgba(255, 255, 255, 0.7), transparent),
    radial-gradient(1.4px 1.4px at 66% 90%, #fff, transparent);
  opacity: 0.7;
  animation: twinkle 5.2s ease-in-out infinite reverse;
}

.city {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 28vh;
  background:
    linear-gradient(180deg, transparent, rgba(4, 8, 20, 0.55) 40%, rgba(4, 8, 20, 0.88)),
    url("../assets/images/conan-city-wide.png") center bottom / cover no-repeat;
  opacity: 0.45;
  mask-image: linear-gradient(180deg, transparent 0%, #000 35%, #000 100%);
}

.sparkles {
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle, rgba(245, 215, 110, 0.9) 0 1.5px, transparent 2px),
    radial-gradient(circle, rgba(255, 255, 255, 0.75) 0 1px, transparent 1.6px),
    radial-gradient(circle, rgba(196, 30, 58, 0.7) 0 1.2px, transparent 1.8px);
  background-size: 180px 220px, 140px 180px, 220px 260px;
  background-position: 10% 20%, 70% 40%, 40% 80%;
  animation: drift 18s linear infinite;
  opacity: 0.45;
}

.deco {
  position: absolute;
  opacity: 0.55;
  filter: drop-shadow(0 0 10px rgba(245, 215, 110, 0.35));
}

.deco-bow {
  left: 50%;
  bottom: 7%;
  width: 54px;
  height: 32px;
  transform: translateX(-50%);
  opacity: 0.28;
}

.app {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 430px;
  min-height: 100dvh;
  background:
    linear-gradient(180deg, rgba(6, 16, 31, 0.2) 0%, rgba(6, 16, 31, 0.08) 40%, rgba(6, 16, 31, 0.55) 100%),
    var(--ink-night);
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

.app::before,
.app::after {
  content: "";
  position: absolute;
  z-index: 3;
  width: 72px;
  height: 72px;
  pointer-events: none;
  opacity: 0.72;
  background:
    linear-gradient(var(--gold), var(--gold)) left top / 18px 2px no-repeat,
    linear-gradient(var(--gold), var(--gold)) left top / 2px 18px no-repeat;
}

.app::before {
  top: calc(10px + var(--safe-top));
  left: 10px;
}

.app::after {
  top: calc(10px + var(--safe-top));
  right: 10px;
  transform: scaleX(-1);
}

.hero {
  position: relative;
  display: block;
  width: 100%;
  line-height: 0;
  text-decoration: none;
  padding-top: var(--safe-top);
  cursor: pointer;
  touch-action: manipulation;
}

.hero img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 818 / 1923;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.hero:active {
  opacity: 0.96;
}

.cta {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 18px 18px calc(22px + var(--safe-bottom));
  background: linear-gradient(180deg, #080c16 0%, #06101f 100%);
  overflow: hidden;
}

.cta::before {
  content: "";
  position: absolute;
  top: 0;
  left: 22px;
  right: 22px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0.7;
}

.cta::after {
  content: "";
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: calc(10px + var(--safe-bottom));
  height: 48px;
  pointer-events: none;
  opacity: 0.38;
  background:
    linear-gradient(var(--gold), var(--gold)) left bottom / 16px 2px no-repeat,
    linear-gradient(var(--gold), var(--gold)) left bottom / 2px 16px no-repeat,
    linear-gradient(var(--gold), var(--gold)) right bottom / 16px 2px no-repeat,
    linear-gradient(var(--gold), var(--gold)) right bottom / 2px 16px no-repeat;
}

.cta-glow {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 82% 8%, rgba(230, 238, 255, 0.22) 0 18px, transparent 48px),
    radial-gradient(circle at 50% 0%, rgba(245, 215, 110, 0.16), transparent 46%),
    radial-gradient(1.2px 1.2px at 12% 30%, #fff, transparent),
    radial-gradient(1px 1px at 28% 62%, rgba(245, 215, 110, 0.9), transparent),
    radial-gradient(1.3px 1.3px at 72% 44%, #fff, transparent),
    radial-gradient(1px 1px at 88% 22%, rgba(255, 255, 255, 0.8), transparent),
    radial-gradient(1.2px 1.2px at 64% 78%, #fff, transparent);
}

.case-line {
  position: relative;
  z-index: 1;
  margin: 2px 0 14px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.28em;
  color: var(--gold);
  text-shadow: 0 0 12px rgba(245, 215, 110, 0.35);
  opacity: 0.88;
}

.case-line::before,
.case-line::after {
  content: "✦";
  display: inline-block;
  margin: 0 8px;
  font-size: 9px;
  opacity: 0.8;
}

.kakao-btn {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  width: 100%;
  max-width: 380px;
  min-height: 74px;
  padding: 12px 18px 12px 14px;
  border-radius: 18px;
  background: var(--kakao);
  color: var(--ink);
  text-decoration: none;
  box-shadow:
    0 0 0 1px rgba(245, 215, 110, 0.35),
    0 8px 24px rgba(254, 229, 0, 0.18),
    0 0 28px rgba(245, 215, 110, 0.12);
  transition: transform 0.16s ease, filter 0.16s ease;
  touch-action: manipulation;
}

.kakao-btn:active {
  transform: scale(0.985);
  filter: brightness(0.96);
}

.kakao-bubble {
  position: relative;
  flex: 0 0 48px;
  width: 48px;
  height: 42px;
  margin-right: 12px;
  background: var(--ink);
  border-radius: 18px 18px 18px 4px;
  display: grid;
  place-items: center;
}

.kakao-bubble::after {
  content: "";
  position: absolute;
  left: 7px;
  bottom: -5px;
  width: 10px;
  height: 10px;
  background: var(--ink);
  clip-path: polygon(0 0, 100% 0, 0 100%);
  transform: rotate(18deg);
}

.kakao-bubble em {
  font-style: normal;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--kakao);
  line-height: 1;
}

.kakao-divider {
  flex: 0 0 1px;
  width: 1px;
  height: 38px;
  margin-right: 12px;
  background: var(--ink);
  opacity: 0.92;
}

.kakao-text {
  flex: 1 1 auto;
  min-width: 0;
}

.kakao-text strong {
  display: block;
  font-size: clamp(17px, 5vw, 20px);
  font-weight: 900;
  letter-spacing: -0.05em;
  line-height: 1.2;
}

.kakao-text span {
  display: block;
  margin-top: 3px;
  font-size: clamp(11px, 3.2vw, 13px);
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.04em;
  white-space: nowrap;
}

.kakao-chevron {
  flex: 0 0 12px;
  width: 12px;
  height: 12px;
  margin-left: 10px;
  border-right: 3px solid var(--ink);
  border-top: 3px solid var(--ink);
  transform: rotate(45deg);
}

@keyframes twinkle {
  0%, 100% { opacity: 0.55; }
  50% { opacity: 1; }
}

@keyframes drift {
  from { background-position: 10% 20%, 70% 40%, 40% 80%; }
  to { background-position: 18% 8%, 62% 28%, 48% 68%; }
}

@media (max-width: 360px) {
  .kakao-text span {
    white-space: normal;
  }

  .case-line {
    letter-spacing: 0.18em;
    text-indent: 0.18em;
    font-size: 11px;
  }
}

@media (max-width: 860px) {
  .sky,
  .stars,
  .city,
  .sparkles,
  .deco-bow {
    display: none;
  }

  .app::before,
  .app::after {
    display: none;
  }
}

@media (min-width: 861px) {
  body {
    background-image:
      linear-gradient(180deg, rgba(4, 8, 20, 0.28) 0%, rgba(4, 8, 20, 0.12) 42%, rgba(4, 8, 20, 0.78) 100%),
      url("../assets/images/conan-city-wide.png");
    background-size: cover;
    background-position: center 28%;
    background-repeat: no-repeat;
    background-attachment: fixed;
  }

  .cta {
    background:
      linear-gradient(180deg, rgba(4, 10, 24, 0.2) 0%, rgba(6, 16, 31, 0.42) 45%, rgba(6, 16, 31, 0.7) 100%),
      url("../assets/images/conan-night-sky.png") center 8% / cover no-repeat;
  }

  .app {
    box-shadow:
      0 0 0 1px rgba(245, 215, 110, 0.28),
      0 0 40px rgba(80, 120, 200, 0.18),
      0 24px 60px rgba(0, 0, 0, 0.45);
  }

  .app::before,
  .app::after {
    width: 84px;
    height: 84px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .stars-a,
  .stars-b,
  .sparkles {
    animation: none;
  }
}
