@charset "UTF-8";

/* ============================================================
   SMNN (소망나무) — 퍼블리싱 기반 페이지 전용 CSS
   @font-face, reset, html/body 스타일은 main.css에서 처리
============================================================ */

:root {
  --font-body: 'Paperlogy', sans-serif;
  --color-dust900: #101828;
  --color-gray950: #111111;
  --color-yellow300: #FDB933;
  --color-gray600: #666666;
  --color-gray150: #F2F2F2;
  --color-dust200: #EAECF0;
  --border-haechi: #eb94bf;
  --border-jujak: #f37865;
  --border-baekho: #221e1f;
  --border-cheongryong: #84d4ed;
  --border-hyunmu: #97d09f;
}

/* ============================================================
   PAGE WRAPPER
============================================================ */
.page {
  width: 100%;
  max-width: 1920px;
  margin: 0 auto;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(32px, 4.17vw, 80px);
  padding-top: 0;
}

/* ============================================================
   HERO SECTION
============================================================ */
.hero {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: clamp(48px, 7.2vw, 96px) 20px 24px;
  min-height: clamp(420px, calc(62vw + 160px), 680px);
  position: relative;
  background: url('../img/wish/bg-contree2.png');
  background-position: center bottom;
  background-repeat: no-repeat;
  background-size: clamp(900px, 130vw, 1920px) auto;
}

.left-tree,
.right-tree {
  display: none;
}
.left-tree img,
.right-tree img {
  display: none;
}

.hero-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
  width: 100%;
}

.hero-title {
  display: flex;
  align-items: center;
}
.hero-title img {
  height: clamp(48px, 6vw, 84px);
  width: auto;
}

.intro-text {
  font-size: clamp(13px, 1.35vw, 26px);
  font-weight: 500;
  line-height: 1.85;
  color: var(--color-dust900);
  text-align: center;
  white-space: normal;
}
.intro-text p { line-height: 140%; margin-bottom: 0; }
.intro-text .gap { height: 0.8em; }

.hero-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  width: 100%;
  margin-top: clamp(28px, 6vw, 60px);
  gap: 15px 0;
  flex: 1;
}

.count-display {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: clamp(6px, 0.625vw, 12px);
  text-align: center;
}
.count-label {
  font-size: clamp(18px, 1.67vw, 32px);
  font-weight: 700;
  color: var(--color-dust900);
  white-space: nowrap;
}
.count-badge-group {
  display: flex;
  align-items: center;
  gap: clamp(2px, 0.21vw, 4px);
}
.count-badge {
  background: #006944;
  border-radius: clamp(6px, 0.625vw, 12px);
  padding: clamp(3px, 0.31vw, 6px) clamp(6px, 0.625vw, 12px);
  font-size: clamp(18px, 1.67vw, 32px);
  font-weight: 700;
  color: #ffffff;
  line-height: 1.2;
  white-space: nowrap;
}
.count-suffix {
  font-size: clamp(18px, 1.67vw, 32px);
  font-weight: 700;
  color: var(--color-dust900);
  white-space: nowrap;
}

/* ============================================================
   CONTENT SECTION
============================================================ */
.content {
  display: flex;
  flex-direction: column;
  gap: clamp(12px, 1.67vw, 32px);
  align-items: stretch;
  padding: 0 clamp(12px, 4.17vw, 80px);
  width: 100%;
}

.wish-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(8px, 0.625vw, 12px);
  min-width: 0;
  padding-top: 20px;
  padding-bottom: 20px;
  /* 스크롤 성능 최적화 */
  will-change: transform, contents;
  contain: layout style;
}

.wish-grid-area > p {
  background: #f6f6f6;
  text-align: center;
  color: #333;
  font-size: clamp(12px, 0.86vw, 16px);
  font-weight: 500;
  border: 1px solid #e0e0e0;
  padding: 10px;
  border-radius: 12px;
}
.wish-row {
  display: contents;
}

/* ============================================================
   WISH CARD ANIMATION (성능 최적화)
============================================================ */
/* 초기 상태 - 투명하고 아래쪽에서 시작 */
.card-fade-in {
  opacity: 0;
  transform: translate3d(0, 15px, 0);
  transition: opacity 0.3s cubic-bezier(0.4, 0.0, 0.2, 1),
              transform 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
  will-change: opacity, transform;
}

/* 애니메이션 완료 상태 */
.card-fade-in.show {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  will-change: auto;
}

/* 카드별 순차 애니메이션을 위한 지연 */
.card-fade-in:nth-child(1) { transition-delay: 0.02s; }
.card-fade-in:nth-child(2) { transition-delay: 0.04s; }
.card-fade-in:nth-child(3) { transition-delay: 0.06s; }
.card-fade-in:nth-child(4) { transition-delay: 0.08s; }
.card-fade-in:nth-child(5) { transition-delay: 0.1s; }
.card-fade-in:nth-child(6) { transition-delay: 0.12s; }

/* ============================================================
   WISH CARD
============================================================ */
.card {
  height: clamp(100px, 34vw, 140px);
  position: relative;
  border-width: clamp(3px, 0.31vw, 6px);
  border-style: solid;
  border-radius: 12px;
  min-width: 0;
  /* 성능 최적화 */
  contain: layout style;
  transform: translateZ(0);
}

.card-white { background: #ffffff; }
.card-gray  { background: var(--color-dust200); }

.card-border-haechi      { border-color: var(--border-haechi); }
.card-border-jujak       { border-color: var(--border-jujak); }
.card-border-cheongryong { border-color: var(--border-cheongryong); }
.card-border-baekho      { border-color: var(--border-baekho); }
.card-border-hyunmu      { border-color: var(--border-hyunmu); }

.card-text {
  position: absolute;
  top: 30.3%;
  left: 10%;
  right: 10%;
  height: 44.4%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: clamp(13px, 1.25vw, 24px);
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: -0.5px;
  color: var(--color-gray950);
  text-align: center;
}
.card-text p {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
  overflow: hidden;
  margin: 0;
}

/* ============================================================
   CHARACTER ILLUSTRATIONS
============================================================ */
.char {
  position: absolute;
  pointer-events: none;
}

.char-h {
  width: auto;
  height: 51.25%;
  aspect-ratio: 128 / 164;
  top: auto;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  overflow: hidden;
}
.char-h img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center bottom;
}

.char-ch {
  width: auto;
  height: 38.4%;
  aspect-ratio: 146 / 123;
  top: auto;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
}
.char-ch img { position: absolute; inset: 0; width: 100%; height: 100%; }

.char-j {
  width: auto;
  height: 33.75%;
  aspect-ratio: 122 / 108;
  top: auto;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
}
.char-j img { position: absolute; inset: 0; width: 100%; height: 100%; }

.char-b {
  width: auto;
  height: 42.5%;
  aspect-ratio: 129 / 136;
  top: auto;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
}
.char-b img { position: absolute; inset: 0; width: 100%; height: 100%; }

.char-hm {
  width: auto;
  height: 48.4%;
  aspect-ratio: 74 / 155;
  top: auto;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
}
.char-hm img { position: absolute; inset: 0; width: 100%; height: 100%; }

/* More button (+) */
.more-btn {
  display: flex;
  position: absolute;
  bottom: 0;
  right: 0;
  width: clamp(28px, 2.08vw, 40px);
  height: clamp(28px, 2.08vw, 40px);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border-radius: 6px 0 6px 0;
}
.more-btn::before {
  content: "";
  display: block;
  background: url("../img/wish/more.svg") center center no-repeat;
  width: clamp(12px, 0.94vw, 18px);
  height: clamp(12px, 0.94vw, 18px);
}
.card-border-haechi .more-btn      { background: var(--border-haechi); }
.card-border-jujak .more-btn       { background: var(--border-jujak); }
.card-border-baekho .more-btn      { background: var(--border-baekho); }
.card-border-cheongryong .more-btn { background: var(--border-cheongryong); }
.card-border-hyunmu .more-btn      { background: var(--border-hyunmu); }

/* ============================================================
   DIGIT ROLLER ANIMATION
============================================================ */
.digit-roller {
  display: inline-flex;
  align-items: center;
  line-height: 1.2;
}
.digit-sep {
  margin: 0 0.04em;
}
.digit-col {
  display: inline-block;
  overflow: hidden;
  height: 1.2em;
  width: 0.72em;
  text-align: center;
  vertical-align: middle;
}
.digit-strip {
  display: flex;
  flex-direction: column;
  will-change: transform;
}
.digit-strip span {
  display: block;
  height: 1.2em;
  line-height: 1.2;
  text-align: center;
}

/* ============================================================
   BIG TREE IMAGE (right side) — hidden on mobile
============================================================ */
.tree-big {
  display: none;
  position: relative;
  flex-shrink: 0;
}
.tree-big-img {
  position: sticky;
  top: 0;
  width: 100%;
  height: 100vh;
  object-fit: cover;
  object-position: right center;
  pointer-events: none;
}
.tree-big-gradient {
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  background: linear-gradient(to right, #ffffff 0%, rgba(255,255,255,0) 100%);
  pointer-events: none;
}

/* ============================================================
   RESPONSIVE BREAKPOINTS
============================================================ */

/* -- Tablet 768px+ -- */
@media (min-width: 768px) {
  .card {
    height: clamp(120px, 18vw, 160px);
    border-radius: 20px;
  }
  .more-btn {
    border-radius: 12px 0 12px 0;
  }
  .hero {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    height: fit-content;
    min-height: clamp(680px, calc(40vw + 320px), 900px);
    padding: clamp(40px, 6vw, 80px) 20px 0;
    gap: 0;
  }
  .hero-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 40px;
    width: 100%;
  }
  .hero-title {
    white-space: nowrap;
  }
  .intro-text {
    white-space: nowrap;
    margin-top: 0;
  }
  .hero-bottom {
    margin-top: clamp(28px, calc(3.5vw + 8px), 60px);
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
  }
  .count-display {
    flex-wrap: nowrap;
  }
  .left-tree,
  .right-tree {
    display: none;
  }
}

/* -- Desktop 1024px+ -- */
@media (min-width: 1024px) {
  .hero {
    min-height: clamp(820px, calc(60vw + 200px), 1000px);
  }
  .content {
    width: 100%;
    padding: 0;
    gap: 0;
    flex-direction: row;
    align-items: stretch;
  }
  .wish-grid {
    display: flex;
    flex-direction: column;
    flex: 1;
  }
  .wish-grid-area {
    display: flex;
    flex-direction: column;
    flex: 1;
  }
  .wish-grid::-webkit-scrollbar { display: none; }
  .wish-grid { scrollbar-width: none; }
  .wish-row {
    display: flex;
    flex-wrap: nowrap;
    flex-shrink: 0;
    gap: clamp(8px, 0.625vw, 12px);
  }
  .card {
    flex: 1;
    height: clamp(140px, 16.67vw, 320px);
  }
  .tree-big {
    display: block;
    flex: 1;
  }
  .tree-big-gradient {
    width: calc(clamp(180px, 23.2vw, 445px) + max(0px, (100vw - 1920px) / 4));
  }
}

/* ============================================================
   WISH POPUP (detail layer)
============================================================ */
.popup-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}
.popup-overlay.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
}
.popup-inner {
  position: relative;
  width: 100%;
  max-width: 646px;
  display: flex;
  flex-direction: column;
  padding-bottom: 20px;
}
.popup-close-row {
  display: flex;
  justify-content: center;
  position: relative;
  z-index: 2;
  margin-bottom: -24px;
}
.popup-close {
  background: #111111;
  border: none;
  border-radius: 999px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}
.popup-close:hover {
  background: #333;
}
.popup-modal {
  background: #ffffff;
  border-radius: clamp(24px, 3.33vw, 40px);
  padding: clamp(48px, 5vw, 60px) clamp(24px, 3.33vw, 40px) clamp(24px, 2.5vw, 40px);
  position: relative;
  z-index: 1;
}
.popup-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(16px, 1.67vw, 20px);
}
.popup-text {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: clamp(15px, 1.25vw, 20px);
  line-height: 1.6;
  color: #101828;
  text-align: center;
}
