/* Overlayly Landing Page (대문) Styles */
:root {
  --landing-bg: #ffffff;
  --landing-accent: #8b5cf6;
  --landing-accent2: #ec4899;
}

body.landing-body {
  margin: 0;
  padding: 0;
  background-color: var(--landing-bg);
  background-image: 
    radial-gradient(circle at 18% 28%, rgba(244, 114, 182, 0.08) 0%, transparent 42%),
    radial-gradient(circle at 82% 30%, rgba(168, 85, 247, 0.07) 0%, transparent 45%),
    radial-gradient(circle at 50% 60%, rgba(59, 130, 246, 0.06) 0%, transparent 55%),
    radial-gradient(circle at 20% 82%, rgba(244, 114, 182, 0.06) 0%, transparent 40%),
    radial-gradient(circle at 80% 85%, rgba(168, 85, 247, 0.07) 0%, transparent 42%);
  color: #1e293b;
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

.landing-container {
  max-width: 1560px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 20px 60px;
  box-sizing: border-box;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  position: relative;
}

/* 1. Hero Head Section (Clean top breathing room) */
.landing-hero-head {
  text-align: center;
  margin: 0 auto 24px;
  max-width: 860px;
  position: relative;
  z-index: 10;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(139, 92, 246, 0.08);
  border: 1px solid rgba(139, 92, 246, 0.22);
  color: #7c3aed;
  font-size: 13px;
  font-weight: 700;
  padding: 6px 18px;
  border-radius: 20px;
  margin-bottom: 22px;
  box-shadow: 0 4px 16px rgba(139, 92, 246, 0.08);
}

.hero-title {
  font-size: 38px;
  font-weight: 800;
  line-height: 1.25;
  margin: 0 0 12px;
  color: #0f172a;
  letter-spacing: -1.4px;
}

.hero-title .gradient-text {
  background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 50%, #3b82f6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-desc {
  font-size: 16px;
  color: #475569;
  line-height: 1.6;
  margin: 0 auto;
  max-width: 600px;
}

/* Center CTA Button Column */
.center-cta-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 20px;
  z-index: 10;
  text-align: center;
}

/* 2. 4 Chat Streams Row (1줄, 2줄, 3줄, 4줄 - Bottom Aligned) */
.landing-streams-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  max-width: 1560px;
  width: 100%;
  margin: 0 auto;
  align-items: flex-end;
  position: relative;
}

.btn-make-chat {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: linear-gradient(135deg, #ec4899 0%, #8b5cf6 50%, #3b82f6 100%);
  color: #ffffff;
  font-size: 18px;
  font-weight: 800;
  padding: 14px 40px;
  border-radius: 50px;
  text-decoration: none;
  box-shadow: 0 12px 36px rgba(139, 92, 246, 0.45), 0 0 0 2px rgba(255, 255, 255, 0.22) inset;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.btn-make-chat:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 18px 46px rgba(139, 92, 246, 0.65), 0 0 0 2px rgba(255, 255, 255, 0.4) inset;
  filter: brightness(1.08);
}

.btn-make-chat:active {
  transform: translateY(1px) scale(0.98);
}

.btn-make-chat .sparkle-icon {
  font-size: 24px;
  animation: pulseSparkle 2s infinite ease-in-out;
}

@keyframes pulseSparkle {
  0%, 100% { transform: scale(1) rotate(0deg); }
  50% { transform: scale(1.25) rotate(15deg); }
}

.hero-sub-note {
  font-size: 13px;
  color: #64748b;
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Floating Chat Stream Wrap */
.floating-stream-wrap {
  width: 100%;
  min-width: 0;
  position: relative;
  transition: transform 0.2s ease;
  cursor: pointer;
}

.floating-stream-wrap:hover {
  transform: translateY(-3px);
}

.stream-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  padding: 0 4px;
}

.stream-theme-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 11px;
  border-radius: 8px;
  background: #ffffff;
  color: #334155;
  border: 1px solid #e2e8f0;
  letter-spacing: -0.2px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
  transition: all 0.15s ease;
}

.floating-stream-wrap:hover .stream-theme-pill {
  background: #f5f3ff;
  color: #7c3aed;
  border-color: #c4b5fd;
  box-shadow: 0 4px 12px rgba(124, 58, 237, 0.12);
}

.stream-action-hint {
  font-size: 11px;
  font-weight: 600;
  color: #64748b;
  opacity: 0;
  transition: opacity 0.15s ease, transform 0.15s ease;
  text-decoration: none;
}

.floating-stream-wrap:hover .stream-action-hint {
  opacity: 1;
  color: #7c3aed;
  transform: translateX(2px);
}

/* Ambient Chat Stage (Transparent, mask-fade at top, uniform bottom baseline) */
.ambient-chat-stage {
  padding: 20px 0 6px;
  background: transparent !important;
  border: none !important;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  height: 350px;
  min-height: 350px;
  mask-image: linear-gradient(to bottom, transparent 0%, black 28px, black 100%);
  -webkit-mask-image: linear-gradient(to bottom, transparent 0%, black 28px, black 100%);
}

.ambient-chat-stage .chat-wrap {
  /* 관리자에서 저장한 원본 폭과 비율을 보존한 채 카드 안에 통째로 축소한다. */
  position: absolute;
  left: 50%;
  bottom: 6px;
  width: var(--landing-source-width, 440px) !important;
  max-width: none !important;
  min-height: auto !important;
  padding: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  transform: translateX(-50%) scale(var(--landing-preview-scale, .72));
  transform-origin: center bottom;
}

.ambient-chat-stage .chat-list {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: var(--gap, 4px);
  width: 100%;
}

.ambient-chat-stage .stretch-safe-frame .chat-list {
  gap: calc(var(--gap, 4px) + 22px);
}

.ambient-chat-stage .message {
  transition: opacity 0.38s ease, transform 0.38s ease, margin 0.38s ease;
  will-change: transform, opacity;
  min-width: 0 !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

/* 일러스트 프레임 뒤에 기본 말풍선 그림자가 사각형으로 비치지 않게 한다. */
.ambient-chat-stage .concept-frame .message {
  background: transparent !important;
  box-shadow: none !important;
}

.ambient-chat-stage .message-content {
  box-sizing: border-box;
  width: 100% !important;
  word-break: keep-all !important;
}

.ambient-chat-stage .concept-frame .message-content,
.ambient-chat-stage .stretch-safe-frame .message-content {
  padding-right: 0 !important;
}

.ambient-chat-stage .message:not(.newest) {
  opacity: 0.65;
}

.ambient-chat-stage .message.message-exit {
  opacity: 0 !important;
  transform: translateY(-10px) scale(0.985) !important;
  margin-top: calc(0px - var(--exit-height, 0px) - var(--gap, 4px)) !important;
  pointer-events: none;
}

.ambient-chat-stage .stretch-safe-frame .message.message-exit {
  margin-top: calc(0px - var(--exit-height, 0px) - var(--gap, 4px) - 22px) !important;
}

/* 3. Bottom Space & Landing Footer */
.landing-footer {
  margin-top: 60px;
  text-align: center;
  padding: 30px 20px;
  border-top: 1px solid #e2e8f0;
  color: #64748b;
  font-size: 13px;
}

.landing-footer a {
  color: #475569;
  text-decoration: none;
  margin: 0 8px;
}

.landing-footer a:hover {
  color: #7c3aed;
}

/* Responsive: 4 cards remain side-by-side on desktop/laptops, scrollable on mobile */
@media (max-width: 860px) {
  .landing-streams-row {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 12px;
    padding-bottom: 12px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }
  .floating-stream-wrap {
    /* 좌우 장식이 큰 프레임도 글자가 한 글자씩 꺾이지 않게 한다. */
    flex: 0 0 360px;
    scroll-snap-align: start;
  }
}

@media (max-width: 680px) {
  .hero-title {
    font-size: 30px;
  }
  .landing-footer {
    margin-top: 40px;
  }
}
