img { background-color: transparent; }
/* ── RESET ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

/* ── BASE — Antimetal light surface + dot grid ───────────────────────────── */
body {
  font-family: 'Noto Sans KR', sans-serif;
  background-color: #f0f4ff;
  min-height: 100vh;
  overflow: hidden;
  position: relative;
  color: #1b2540;
}

/* ── GLOW ORB SCENE ──────────────────────────────────────────────────────── */
.glow-scene {
  position: fixed;
  inset: 0;
  display: flex; align-items: center; justify-content: center;
  z-index: 0; pointer-events: none;
  overflow: hidden;
}

/* 중앙 글로우 코어 — 도트 지구본 */
.glow-core {
  width: 280px; height: 280px;
  border-radius: 50%;
  background: none;
  box-shadow:
    0 0  50px 15px rgba(30,130,255,0.5),
    0 0 100px 40px rgba(20,100,255,0.25),
    0 0 180px 80px rgba(10,60,255,0.12);
  opacity: 0;
  animation: core-appear 1s cubic-bezier(0.22,1,0.36,1) 0.1s forwards,
             core-pulse  5s ease-in-out 1.2s infinite;
}

@keyframes core-appear {
  0%   { opacity: 0; transform: scale(0.3); }
  60%  { opacity: 1; transform: scale(1.08); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes core-pulse {
  0%,100% { transform: scale(1);    box-shadow: 0 0 40px 10px rgba(80,160,255,0.9), 0 0 90px 30px rgba(40,120,255,0.6), 0 0 160px 60px rgba(20,80,255,0.35), 0 0 260px 100px rgba(10,50,255,0.15); }
  50%     { transform: scale(1.06); box-shadow: 0 0 60px 20px rgba(80,160,255,1),   0 0 130px 50px rgba(40,120,255,0.7), 0 0 220px 90px rgba(20,80,255,0.4),  0 0 340px 140px rgba(10,50,255,0.2); }
}

/* 동심원 파동 */
.glow-ring {
  position: absolute;
  border-radius: 50%;
  border: 3px dotted rgba(30,130,255,0.55);
  background: none;
  opacity: 0;
}
.r1 { width: 320px;  height: 320px;  animation: ring-wave 3.6s ease-out 0.8s infinite; }
.r2 { width: 320px;  height: 320px;  animation: ring-wave 3.6s ease-out 2.0s infinite; }
.r3 { width: 320px;  height: 320px;  animation: ring-wave 3.6s ease-out 3.2s infinite; }

@keyframes ring-wave {
  0%   { transform: scale(1);   opacity: 0.7; }
  100% { transform: scale(3.2); opacity: 0; }
}

/* 배경 ambient glow */
.glow-scene::before {
  content: '';
  position: absolute;
  width: 80vw; height: 80vh;
  border-radius: 50%;
  background: radial-gradient(circle,
    rgba(80,150,255,0.12) 0%,
    rgba(40,100,255,0.06) 50%,
    transparent 75%
  );
  animation: ambient 8s ease-in-out 1s infinite;
}
@keyframes ambient {
  0%,100% { transform: scale(1);    opacity: 1; }
  50%     { transform: scale(1.15); opacity: 0.7; }
}

/* ── SCREEN TRANSITIONS ──────────────────────────────────────────────────── */
.screen {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  z-index: 10;
  transition: opacity .4s ease, transform .4s ease;
}
.screen.off { opacity: 0; pointer-events: none; transform: translateY(16px); }

/* ── WELCOME CARD — white elevated on dotted surface ────────────────────── */
.welcome-card {
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 24px;
  padding: 56px 72px;
  text-align: center;
  box-shadow:
    rgba(0,39,80,0.04) 0px 0px 0px 1px,
    rgba(0,39,80,0.06) 0px 24px 48px -8px,
    rgba(0,80,248,0.08) 0px 48px 80px -16px;
  max-width: 480px; width: 90%;
  animation: fadeUp .8s cubic-bezier(0.22,1,0.36,1) 2s both;
  position: relative; z-index: 1;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.logo-wrap { width: 110px; height: 110px; margin: 0 auto 20px; }
.logo-wrap img { width: 100%; height: 100%; object-fit: contain; background-color: transparent; }

.jai-name {
  font-family: 'Cormorant Garamond', serif;
  font-size: 52px; font-weight: 600;
  color: #1b2540; letter-spacing: 12px; margin-bottom: 6px;
  text-shadow: 0 0 20px rgba(255,255,255,0.9), 0 2px 8px rgba(255,255,255,0.8);
}
.jai-tagline { font-size: 13px; color: #000000; letter-spacing: 1.5px; margin-bottom: 48px; text-shadow: 0 0 16px rgba(255,255,255,0.95), 0 2px 6px rgba(255,255,255,0.8); }

.mode-row { display: flex; gap: 18px; justify-content: center; }
.mode-btn {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 28px 32px; border-radius: 16px;
  border: none;
  background: rgba(180,180,180,0.1);
  cursor: pointer; transition: all .25s;
  color: #1b2540; font-size: 12px;
  font-family: 'Noto Sans KR', sans-serif;
  letter-spacing: 0.5px; text-transform: uppercase; min-width: 130px;
  box-shadow: none;
}
.mode-btn svg { width: 90px; height: 90px; filter: drop-shadow(0 2px 8px rgba(255,255,255,0.6)) drop-shadow(0 0 12px rgba(255,255,255,0.4)); }
.mode-btn:hover {
  background: #f0f6ff;
  border-color: rgba(0,80,248,0.25);
  transform: translateY(-4px);
  box-shadow: rgba(0,39,80,0.04) 0px 0px 0px 1px, rgba(0,80,248,0.12) 0px 16px 40px -8px;
}

.nav-links { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 20px; }
.nav-link {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; color: #596075; text-decoration: none;
  letter-spacing: .2px; transition: color .2s;
  -webkit-tap-highlight-color: transparent;
}
.nav-link:hover { color: #0050f8; }
.nav-divider { color: #b1b5c0; font-size: 14px; }

/* ── CHAT WRAP ───────────────────────────────────────────────────────────── */
.chat-wrap {
  background: #ffffff;
  border-radius: 24px;
  border: none;
  width: 90%; max-width: 760px; height: 88vh;
  display: flex; flex-direction: column; overflow: hidden;
  box-shadow:
    rgba(0,39,80,0.04) 0px 0px 0px 1px,
    rgba(0,39,80,0.06) 0px 24px 48px -8px,
    rgba(0,80,248,0.06) 0px 48px 80px -16px;
  animation: fadeUp .5s ease both;
  position: relative; z-index: 1;
}

.chat-header {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 26px;
  border-bottom: 1px solid rgba(0,39,80,0.07);
  background: #ffffff;
}
.chat-header .mini-logo { width: 38px; height: 38px; object-fit: contain; background-color: transparent; }
.chat-header h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 24px; font-weight: 600;
  color: #1b2540; letter-spacing: 5px; flex: 1;
}
.mode-tag {
  font-size: 11px; background: #eef3ff; color: #0050f8;
  padding: 4px 12px; border-radius: 9999px;
  border: 1px solid rgba(0,80,248,0.15); letter-spacing: 0.4px;
}
.voice-switch-btn {
  background: none; border: 1px solid rgba(0,39,80,0.15);
  cursor: pointer; color: #596075;
  padding: 7px 10px; border-radius: 9999px; transition: all .2s;
  display: flex; align-items: center; justify-content: center;
}
.voice-switch-btn:hover { background: #eef3ff; border-color: rgba(0,80,248,0.3); color: #0050f8; }
.back-btn {
  background: none; border: none; cursor: pointer;
  color: #b1b5c0; padding: 8px;
  border-radius: 9999px; transition: all .2s; font-size: 18px; line-height: 1;
}
.back-btn:hover { background: #f0f4ff; color: #596075; }

.messages {
  flex: 1; padding: 28px 26px;
  overflow-y: auto; display: flex; flex-direction: column; gap: 14px;
  scroll-behavior: smooth;
}
.messages::-webkit-scrollbar { width: 4px; }
.messages::-webkit-scrollbar-track { background: transparent; }
.messages::-webkit-scrollbar-thumb { background: rgba(0,39,80,0.12); border-radius: 4px; }

/* Empty state */
.empty-state {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; text-align: center; padding: 40px;
}
.sparkle-anim { margin-bottom: 24px; animation: pulse 2.5s ease-in-out infinite; }
@keyframes pulse {
  0%,100% { transform: scale(1); opacity: .9; }
  50%     { transform: scale(1.08); opacity: 1; }
}
.empty-state h2 { font-size: 20px; color: #1b2540; font-weight: 400; margin-bottom: 28px; }
.sug-label { font-size: 11px; color: #7c8293; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 12px; }
.sug-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.sug-chip {
  background: #ffffff;
  border: 1px solid rgba(0,39,80,0.1);
  border-radius: 9999px; padding: 10px 18px;
  font-size: 12.5px; color: #596075;
  cursor: pointer; transition: all .2s; text-align: center; line-height: 1.4;
  box-shadow: rgba(0,39,80,0.04) 0px 2px 8px;
}
.sug-chip:hover { background: #eef3ff; border-color: rgba(0,80,248,0.25); color: #0050f8; transform: translateY(-1px); }

/* Message bubbles */
.msg { display: flex; gap: 10px; align-items: flex-start; }
.msg.user { flex-direction: row-reverse; }
.msg-av {
  width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
  overflow: hidden; background: #eef3ff;
  display: flex; align-items: center; justify-content: center;
}
.msg-av img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.msg.ai .msg-av { width: 72px; height: 72px; border-radius: 14px; }
.msg-av .av-logo { width: 22px; height: 22px; object-fit: contain; }
.bubble {
  max-width: 68%; padding: 12px 16px; border-radius: 16px;
  font-size: 13.5px; line-height: 1.65;
}
.msg.ai   .bubble {
  background: #f0f6ff; color: #1b2540;
  border: 1px solid rgba(0,39,80,0.07);
  border-bottom-left-radius: 4px;
  box-shadow: rgba(0,39,80,0.04) 0px 2px 8px;
}
.msg.user .bubble {
  background: #0050f8; color: #fff;
  border-bottom-right-radius: 4px;
}

/* Typing indicator */
.typing { display: flex; gap: 5px; align-items: center; padding: 14px 18px; }
.dot { width: 7px; height: 7px; background: #b1b5c0; border-radius: 50%; animation: bounce 1.2s ease infinite; }
.dot:nth-child(2) { animation-delay: .2s; }
.dot:nth-child(3) { animation-delay: .4s; }
@keyframes bounce {
  0%,60%,100% { transform: translateY(0); }
  30%          { transform: translateY(-6px); }
}

/* Input */
.input-area { padding: 16px 24px; border-top: 1px solid rgba(0,39,80,0.07); }
.input-row {
  display: flex; align-items: center; gap: 10px;
  background: #f8f9fc;
  border-radius: 9999px; padding: 8px 8px 8px 20px;
  border: 1px solid rgba(0,39,80,0.1); transition: border-color .2s;
  box-shadow: rgba(0,39,80,0.04) 0px 0px 0px 1px inset;
}
.input-row:focus-within { border-color: rgba(0,80,248,0.4); }
.chat-input {
  flex: 1; background: none; border: none; outline: none;
  font-size: 13.5px; color: #1b2540;
  font-family: 'Noto Sans KR', sans-serif; letter-spacing: -0.01em;
}
.chat-input::placeholder { color: #b1b5c0; }
.send-btn {
  width: 36px; height: 36px; border-radius: 9999px;
  background: #0050f8; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: all .2s;
}
.send-btn:hover { background: #001033; transform: scale(1.05); }

/* ── VOICE SCREEN ────────────────────────────────────────────────────────── */
.voice-wrap {
  background: #ffffff;
  border-radius: 24px;
  width: 90%; max-width: 480px; padding: 56px 40px; text-align: center;
  box-shadow:
    rgba(0,39,80,0.04) 0px 0px 0px 1px,
    rgba(0,39,80,0.06) 0px 24px 48px -8px,
    rgba(0,80,248,0.08) 0px 48px 80px -16px;
  animation: fadeUp .5s ease both; position: relative; z-index: 1;
}
.voice-logo { width: 70px; height: 70px; margin: 0 auto 20px; }
.voice-logo img { width: 100%; object-fit: contain; background-color: transparent; }
.voice-title { font-family: 'Cormorant Garamond', serif; font-size: 28px; color: #1b2540; letter-spacing: 5px; margin-bottom: 6px; }
.voice-sub { font-size: 12px; color: #7c8293; margin-bottom: 40px; letter-spacing: 1px; }

.mic-ring-wrap { position: relative; width: 140px; height: 140px; margin: 0 auto 32px; }
.mic-ring {
  position: absolute; top: 50%; left: 50%;
  width: 140px; height: 140px; border-radius: 50%;
  border: 1.5px solid rgba(0,80,248,0.2);
  transform: translate(-50%,-50%) scale(1);
  animation: ripple 2s ease-out infinite;
}
.mic-ring:nth-child(2) { animation-delay: .5s; }
.mic-ring:nth-child(3) { animation-delay: 1s; }
@keyframes ripple {
  0%   { transform: translate(-50%,-50%) scale(.8); opacity: 1; }
  100% { transform: translate(-50%,-50%) scale(1.8); opacity: 0; }
}
.mic-btn {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  width: 80px; height: 80px; border-radius: 9999px;
  background: #0050f8; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all .3s; z-index: 5;
  box-shadow: rgba(0,80,248,0.3) 0px 8px 28px;
}
.mic-btn:hover { background: #001033; transform: translate(-50%,-50%) scale(1.08); }
.mic-btn.listening { background: #001033; animation: glow 1s ease-in-out infinite alternate; }
@keyframes glow {
  from { box-shadow: rgba(0,80,248,0.3) 0px 8px 28px; }
  to   { box-shadow: rgba(0,80,248,0.6) 0px 12px 48px; }
}

.voice-status { font-size: 13px; color: #596075; margin-bottom: 28px; min-height: 20px; }
.wave-canvas { width: 100%; height: 50px; margin-bottom: 28px; border-radius: 8px; }
.voice-back {
  background: #ffffff; border: 1px solid rgba(0,39,80,0.12);
  color: #596075; padding: 10px 28px; border-radius: 9999px;
  cursor: pointer; font-size: 12px; transition: all .2s;
  box-shadow: rgba(0,39,80,0.04) 0px 2px 8px;
}
.voice-back:hover { background: #eef3ff; border-color: rgba(0,80,248,0.25); color: #0050f8; }

/* ── BRUSH LAYER (subtle on light bg) ───────────────────────────────────── */
.brush-layer { position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: 0.06; }

/* ── RESPONSIVE ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  body { overflow-y: auto; background-size: 18px 18px; }
  #welcome { position: relative; min-height: 100vh; align-items: center; padding: 20px 16px; overflow-y: auto; }
  .welcome-card { padding: 36px 24px; margin: auto; }
  .jai-name { font-size: 36px; letter-spacing: 8px; }
  .mode-row { flex-direction: row !important; gap: 10px; justify-content: center; }
  .mode-btn { min-width: 0 !important; flex: 1; padding: 20px 10px; font-size: 10px; gap: 8px; }
  .mode-btn svg { width: 50px !important; height: 50px !important; }
  .chat-wrap { width: 100%; height: 100vh; border-radius: 0; }
  .voice-wrap { width: 95%; padding: 40px 24px; }
  .bubble { max-width: calc(100% - 56px); }
  .bg-orb-1 { width: 120vw; height: 120vw; filter: blur(50px); }
  .bg-orb-2, .bg-orb-3 { width: 70vw; height: 70vw; }
}

/* ── VIDEO BACKGROUND ──────────────────────────────────────────── */
.video-bg-wrap {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
#bgVideo {
  position: absolute;
  top: 0; right: 0; bottom: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: none;
}
.video-gradient-top {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 180px;
  background: linear-gradient(to bottom, rgba(255,255,255,0.85) 0%, transparent 100%);
  z-index: 1;
}
.video-gradient-bottom {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 300px;
  background: linear-gradient(to top, #ffffff 0%, transparent 100%);
  z-index: 1;
}
.glow-scene { display: none; }

/* 모바일 비디오 숨김 */
@media (max-width: 768px) {
  .video-bg-wrap { display: none; }
}

.beach-bg.active { display: block; }
.beach-bg video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.beach-tint {
  position: absolute; inset: 0;
  background: rgba(255,255,255,0.05);
  z-index: 1;
}
.beach-hero-text {
  position: absolute; inset: 0;
  z-index: 2; pointer-events: none;
  display: flex; flex-direction: column;
  align-items: center; justify-content: flex-start;
  padding-top: 96px; text-align: center; px: 24px;
  opacity: 0;
  animation: none;
}
.beach-hero-text.visible {
  animation: fade-rise 1.5s cubic-bezier(0.16,1,0.3,1) forwards;
}
.beach-headline {
  font-family: 'Instrument Serif', serif;
  font-size: clamp(38px, 6vw, 72px);
  line-height: 0.85; letter-spacing: -2px;
  color: #1a1a1a; margin-bottom: 24px;
}
.beach-sub {
  font-family: 'Inter', sans-serif;
  font-size: clamp(16px, 2vw, 18px);
  color: rgba(26,26,26,0.7);
  line-height: 1.65; max-width: 520px;
  opacity: 0;
  animation: none;
}
.beach-sub.visible {
  animation: fade-rise 1.2s cubic-bezier(0.16,1,0.3,1) 0.3s forwards;
}

@media (max-width: 768px) {
  .beach-bg { display: none !important; }
}

.beach-bg.active { display: block; }
.beach-bg video {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}
.beach-tint {
  position: absolute; inset: 0;
  background: rgba(255,255,255,0.05);
  z-index: 1;
}
.beach-hero-text {
  position: absolute; inset: 0;
  z-index: 2; pointer-events: none;
  display: flex; flex-direction: column;
  align-items: center; justify-content: flex-start;
  padding-top: 96px; text-align: center; px: 24px;
  opacity: 0;
  animation: none;
}
.beach-hero-text.visible {
  animation: fade-rise 1.5s cubic-bezier(0.16,1,0.3,1) forwards;
}
.beach-headline {
  font-family: 'Instrument Serif', serif;
  font-size: clamp(38px, 6vw, 72px);
  line-height: 0.85; letter-spacing: -2px;
  color: #1a1a1a; margin-bottom: 24px;
}
.beach-sub {
  font-family: 'Inter', sans-serif;
  font-size: clamp(16px, 2vw, 18px);
  color: rgba(26,26,26,0.7);
  line-height: 1.65; max-width: 520px;
  opacity: 0;
  animation: none;
}
.beach-sub.visible {
  animation: fade-rise 1.2s cubic-bezier(0.16,1,0.3,1) 0.3s forwards;
}

@media (max-width: 768px) {
  .beach-bg { display: none !important; }
}

/* 독립 투명 로고 프레임 */
.floating-logo {
  position: absolute;
  top: calc(50% - 170px);
  left: 50%;
  transform: translateX(-50%);
  width: 110px; height: 110px;
  background: transparent !important;
  z-index: 20;
}
.floating-logo img {
  width: 100%; height: 100%;
  object-fit: contain;
  background: transparent !important;
}

/* 원형 버튼 3개 */
.sug-row {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  gap: 20px;
  justify-content: center;
  align-items: center;
  margin-top: 8px;
}
.sug-chip {
  width: 96px !important;
  height: 96px !important;
  border-radius: 50% !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  font-size: 11.5px !important;
  font-weight: 500 !important;
  line-height: 1.45 !important;
  padding: 10px !important;
  max-width: none !important;
  background: rgba(180,180,180,0.1) !important;
  border: none !important;
  box-shadow: 0 4px 20px rgba(0,0,0,0.10), 0 1px 4px rgba(0,0,0,0.06) !important;
  color: #444444 !important;
  word-break: keep-all;
  cursor: pointer;
  transition: color .25s, box-shadow .25s, transform .25s !important;
  -webkit-tap-highlight-color: transparent;
}
.sug-chip:hover {
  color: #5bbfea !important;
  background: rgba(255,255,255,1) !important;
  box-shadow: 0 8px 28px rgba(91,191,234,0.25), 0 2px 8px rgba(0,0,0,0.08) !important;
  transform: translateY(-3px) !important;
}

/* 모바일에서 배경 비디오 숨김 */
@media (max-width: 768px) {
  .video-bg-wrap { display: none !important; }
  #bgVideo { display: none !important; }
}
