/* ── 나전칠기 (Najeonchilgi) Design System ── */
/* Mother-of-pearl lacquerware aesthetic */

@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+KR:wght@300;400;600;700&display=swap');

:root {
  --lacquer:        #07080c;
  --lacquer-panel:  #0e0f14;
  --lacquer-card:   #13151b;
  --lacquer-lift:   #1a1c24;
  --gold:           #c8a052;
  --gold-light:     #e8c878;
  --gold-dim:       #7a6030;
  --pearl-a:        #88c8d8;  /* 청옥빛 */
  --pearl-b:        #c8a0d8;  /* 자수정빛 */
  --pearl-c:        #d8c888;  /* 황금빛 */
  --pearl-d:        #88d8b8;  /* 비취빛 */
  --pearl-e:        #d890a8;  /* 산호빛 */
  --text-cream:     #f0e8d8;
  --text-mid:       rgba(240, 232, 216, 0.65);
  --text-dim:       rgba(240, 232, 216, 0.38);
  --border-gold:    rgba(200, 160, 82, 0.35);
  --border-pearl:   rgba(136, 200, 216, 0.2);
}

/* ── Reset ── */
* { margin: 0; padding: 0; box-sizing: border-box; }

/* ── Base ── */
body {
  font-family: 'Noto Serif KR', 'Malgun Gothic', Georgia, serif;
  background: var(--lacquer);
  min-height: 100vh;
  color: var(--text-cream);
  /* 옻칠 나무결 느낌의 미세 패턴 */
  background-image:
    radial-gradient(ellipse at 20% 20%, rgba(200,160,82,0.03) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 80%, rgba(136,200,216,0.03) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 50%, rgba(200,160,82,0.015) 0%, transparent 70%);
}

/* ── 자개 shimmer 애니메이션 ── */
@keyframes pearlShimmer {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes goldPulse {
  0%, 100% { opacity: 0.7; }
  50%       { opacity: 1; }
}
@keyframes scanMove {
  0%   { top: 0; }
  50%  { top: calc(100% - 4px); }
  100% { top: 0; }
}

/* ── Navigation ── */
.nav-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 28px;
  background: rgba(7, 8, 12, 0.97);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-gold);
  /* 상단 금빛 라인 */
  box-shadow: 0 1px 0 rgba(200, 160, 82, 0.15), 0 4px 24px rgba(0,0,0,0.6);
}

.nav-logo {
  color: var(--gold-light);
  font-size: 1.1rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: 0.03em;
  text-shadow: 0 0 20px rgba(232, 200, 120, 0.4);
}

.nav-links { display: flex; gap: 28px; }
.nav-links a {
  color: var(--text-mid);
  text-decoration: none;
  font-size: 0.88rem;
  letter-spacing: 0.04em;
  transition: color 0.2s;
}
.nav-links a:hover { color: var(--gold-light); }

.lang-toggle {
  background: transparent;
  border: 1px solid var(--border-gold);
  color: var(--gold);
  padding: 4px 14px;
  border-radius: 2px;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 1px;
  font-family: inherit;
}
.lang-toggle:hover {
  background: rgba(200,160,82,0.1);
  border-color: var(--gold-light);
  color: var(--gold-light);
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--gold);
  font-size: 1.4rem;
  cursor: pointer;
}

@media (max-width: 600px) {
  .nav-links {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    background: rgba(7, 8, 12, 0.99);
    padding: 20px 28px;
    gap: 18px;
    border-bottom: 1px solid var(--border-gold);
  }
  .nav-links.open { display: flex; }
  .nav-toggle { display: block; }
}

/* ── 자개 구분선 장식 mixin ── */
.pearl-divider {
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--pearl-a) 20%,
    var(--gold) 40%,
    var(--pearl-b) 60%,
    var(--pearl-d) 80%,
    transparent 100%);
  opacity: 0.5;
  margin: 0 auto;
  max-width: 600px;
}

/* ── Hero Section ── */
.hero-section {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 84vh;
  padding: 100px 20px 60px;
  text-align: center;
  position: relative;
  overflow: hidden;
}

/* 배경 자개 원형 glow */
.hero-section::before {
  content: '';
  position: absolute;
  width: 600px; height: 600px;
  left: 50%; top: 50%;
  transform: translate(-50%, -55%);
  background: radial-gradient(ellipse,
    rgba(136,200,216,0.06) 0%,
    rgba(200,160,82,0.04) 40%,
    transparent 70%);
  pointer-events: none;
}

.hero-content { max-width: 620px; position: relative; z-index: 1; }

.header-icon { font-size: 3.5rem; margin-bottom: 16px; }

h1 {
  color: var(--gold-light);
  font-size: 2.6rem;
  font-weight: 700;
  margin-bottom: 18px;
  letter-spacing: 0.04em;
  text-shadow: 0 0 40px rgba(232, 200, 120, 0.3);
}

.hero-desc {
  color: var(--text-mid);
  font-size: 1.05rem;
  line-height: 1.9;
  margin-bottom: 36px;
  font-weight: 300;
}

.hero-cta {
  display: inline-block;
  text-decoration: none;
  padding: 16px 52px;
  font-size: 1.1rem;
}

/* ── Content Sections ── */
.content-section {
  padding: 72px 20px;
  position: relative;
}

/* 섹션 상단 금빛 경계선 */
.content-section + .content-section::before {
  content: '';
  display: block;
  height: 1px;
  background: linear-gradient(90deg,
    transparent,
    rgba(200,160,82,0.3) 30%,
    rgba(136,200,216,0.2) 50%,
    rgba(200,160,82,0.3) 70%,
    transparent);
  margin-bottom: 72px;
  margin-top: -72px;
}

.section-inner { max-width: 900px; margin: 0 auto; }

.content-section h2 {
  color: var(--gold-light);
  font-size: 1.7rem;
  margin-bottom: 20px;
  text-align: center;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.content-section h3 {
  color: var(--text-cream);
  font-size: 1.15rem;
  margin: 28px 0 16px;
  letter-spacing: 0.03em;
}

.content-section p {
  color: var(--text-mid);
  font-size: 0.97rem;
  line-height: 1.9;
  margin-bottom: 12px;
  font-weight: 300;
}

.section-desc {
  text-align: center;
  margin-bottom: 36px;
}

.alt-bg {
  background: var(--lacquer-panel);
}

/* ── Info Grid (Steps) ── */
.info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 36px;
}

.info-card {
  background: var(--lacquer-card);
  border-radius: 4px;
  padding: 32px 22px;
  text-align: center;
  border: 1px solid var(--border-gold);
  position: relative;
  /* 자개빛 코너 장식 */
  box-shadow:
    inset 0 0 30px rgba(136,200,216,0.03),
    0 4px 20px rgba(0,0,0,0.4);
}

/* 카드 코너 장식 */
.info-card::before,
.info-card::after {
  content: '';
  position: absolute;
  width: 14px; height: 14px;
  border-color: var(--gold);
  border-style: solid;
  opacity: 0.6;
}
.info-card::before { top: 6px; left: 6px; border-width: 1px 0 0 1px; }
.info-card::after  { bottom: 6px; right: 6px; border-width: 0 1px 1px 0; }

.info-icon { font-size: 2rem; margin-bottom: 14px; }

.info-card h3 {
  color: var(--gold-light);
  font-size: 1rem;
  margin-bottom: 10px;
  letter-spacing: 0.04em;
}

.info-card p { font-size: 0.88rem; }

@media (max-width: 600px) {
  .info-grid { grid-template-columns: 1fr; }
}

/* ── App Section ── */
.app-section {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 40px 20px;
}

/* ── Main Container (Upload / Analyzing / Result) ── */
.container {
  background: var(--lacquer-card);
  border-radius: 4px;
  padding: 44px 34px;
  border: 1px solid var(--border-gold);
  box-shadow:
    0 0 0 1px rgba(136,200,216,0.06),
    0 24px 64px rgba(0,0,0,0.6),
    inset 0 1px 0 rgba(200,160,82,0.08);
  text-align: center;
  max-width: 500px;
  width: 100%;
  position: relative;
}

/* 컨테이너 코너 장식 */
.container::before,
.container::after {
  content: '';
  position: absolute;
  width: 20px; height: 20px;
  border-color: var(--gold);
  border-style: solid;
  opacity: 0.5;
}
.container::before { top: 10px; left: 10px; border-width: 1px 0 0 1px; }
.container::after  { bottom: 10px; right: 10px; border-width: 0 1px 1px 0; }

.container h2 { color: var(--gold-light); }

.container p,
.container .subtitle,
.container .upload-text,
.container .upload-hint,
.container .disclaimer {
  color: var(--text-mid);
}

.result-container { max-width: 540px; }

.section-title {
  color: var(--gold-light);
  font-size: 1.5rem;
  margin-bottom: 8px;
  letter-spacing: 0.04em;
}

/* ── Upload Screen ── */
.subtitle {
  color: var(--text-mid);
  font-size: 0.93rem;
  margin-bottom: 30px;
  line-height: 1.6;
  font-weight: 300;
}

.upload-area {
  border: 1px dashed rgba(200,160,82,0.4);
  border-radius: 4px;
  padding: 44px 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  background: rgba(200,160,82,0.03);
  margin-bottom: 22px;
}

.upload-area:hover, .upload-area.dragover {
  border-color: var(--gold);
  background: rgba(200,160,82,0.07);
  box-shadow: 0 0 24px rgba(200,160,82,0.1);
}

.upload-icon { font-size: 2.8rem; margin-bottom: 12px; }

.upload-text {
  font-size: 1rem;
  color: var(--text-cream) !important;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.upload-hint {
  font-size: 0.82rem;
  color: var(--text-dim) !important;
  margin-top: 6px;
}

.preview-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.preview-area img {
  width: 200px; height: 200px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid var(--gold);
  box-shadow:
    0 0 0 4px rgba(200,160,82,0.15),
    0 8px 32px rgba(0,0,0,0.5);
}

/* ── Buttons ── */
.btn {
  border: none;
  padding: 14px 44px;
  font-size: 1rem;
  border-radius: 2px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-weight: 600;
  font-family: inherit;
  letter-spacing: 0.06em;
}

.btn-primary {
  /* 자개빛 그라디언트 */
  background: linear-gradient(135deg,
    #b89040 0%,
    #e8c878 30%,
    #a8c8d8 55%,
    #c8a0d8 75%,
    #c8a052 100%);
  background-size: 200% 200%;
  animation: pearlShimmer 4s ease infinite;
  color: #07080c;
  box-shadow: 0 4px 20px rgba(200,160,82,0.3);
  text-shadow: none;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(200,160,82,0.45);
}

.btn-primary:disabled {
  opacity: 0.3;
  cursor: not-allowed;
  animation: none;
  background: #3a3520;
  color: #7a7060;
}

.btn-secondary {
  background: transparent;
  color: var(--gold);
  border: 1px solid var(--border-gold);
  padding: 8px 22px;
  font-size: 0.88rem;
}

.btn-secondary:hover {
  background: rgba(200,160,82,0.08);
  border-color: var(--gold);
}

.disclaimer {
  margin-top: 22px;
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* ── Analyzing Screen ── */
.scanner-wrapper {
  position: relative;
  width: 200px; height: 200px;
  margin: 0 auto 28px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid var(--gold);
  box-shadow:
    0 0 0 4px rgba(200,160,82,0.12),
    0 0 40px rgba(136,200,216,0.15);
}

.scan-photo { width: 100%; height: 100%; object-fit: cover; }

.scan-line {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 3px;
  background: linear-gradient(90deg,
    transparent,
    var(--pearl-a),
    var(--gold-light),
    var(--pearl-b),
    transparent);
  box-shadow: 0 0 12px var(--gold-light);
  animation: scanMove 1.5s ease-in-out infinite;
}

.analyzing-text {
  color: var(--gold-light);
  font-size: 1.2rem;
  margin-bottom: 18px;
  letter-spacing: 0.04em;
}

.progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(200,160,82,0.1);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 14px;
  border: 1px solid rgba(200,160,82,0.15);
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg,
    var(--pearl-a),
    var(--gold),
    var(--pearl-b),
    var(--gold-light));
  background-size: 200% 100%;
  animation: pearlShimmer 2s linear infinite;
  border-radius: 3px;
  transition: width 0.4s ease;
}

.analyzing-detail {
  color: var(--text-dim);
  font-size: 0.87rem;
  letter-spacing: 0.02em;
}

/* ── Result Screen ── */
.result-card { text-align: center; }

.result-photo-wrap {
  margin-bottom: -44px;
  position: relative;
  z-index: 2;
}

.result-photo {
  width: 120px; height: 120px;
  object-fit: cover;
  border-radius: 50%;
  border: 2px solid var(--gold);
  box-shadow:
    0 0 0 5px rgba(200,160,82,0.12),
    0 8px 24px rgba(0,0,0,0.5);
}

.result-type-badge {
  padding: 54px 22px 24px;
  border-radius: 4px;
  color: white;
  margin-bottom: 20px;
  border: 1px solid rgba(200,160,82,0.3);
  position: relative;
  overflow: hidden;
}

/* 뱃지 자개빛 오버레이 */
.result-type-badge::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg,
    rgba(255,255,255,0.05) 0%,
    rgba(136,200,216,0.05) 50%,
    rgba(255,255,255,0.02) 100%);
  pointer-events: none;
}

.result-emoji {
  font-size: 2.5rem;
  display: block;
  margin-bottom: 8px;
}

.result-type-name {
  font-size: 1.5rem;
  margin-bottom: 4px;
  letter-spacing: 0.04em;
}

.result-type-ko {
  font-size: 0.9rem;
  opacity: 0.8;
}

.result-desc {
  color: var(--text-mid);
  font-size: 0.97rem;
  line-height: 1.7;
  margin-bottom: 22px;
  padding: 0 8px;
  font-weight: 300;
}

.result-section {
  text-align: left;
  background: var(--lacquer-lift);
  border-radius: 4px;
  padding: 18px 20px;
  margin-bottom: 12px;
  border: 1px solid rgba(200,160,82,0.15);
  box-shadow: inset 0 1px 0 rgba(200,160,82,0.06);
}

.result-section h3 {
  font-size: 0.95rem;
  color: var(--gold);
  margin-bottom: 12px;
  letter-spacing: 0.04em;
  text-transform: none;
}

.feature-list { list-style: none; }
.feature-list li {
  padding: 7px 0;
  color: var(--text-mid);
  font-size: 0.88rem;
  border-bottom: 1px solid rgba(200,160,82,0.08);
}
.feature-list li:last-child { border-bottom: none; }

.tag-list { list-style: none; }
.tag-list li { padding: 4px 0; font-size: 0.9rem; }
.tag-list.pros li { color: var(--pearl-d); }
.tag-list.cons li { color: var(--pearl-e); }

.match-section {
  border-left: 3px solid var(--gold);
  background: rgba(200,160,82,0.05);
}

.match-text { font-size: 0.97rem; color: var(--text-mid); }

.fortune-section { background: var(--lacquer-lift); }

.fortune-bar-wrap {
  width: 100%;
  height: 26px;
  background: rgba(200,160,82,0.08);
  border-radius: 3px;
  overflow: hidden;
  margin: 10px 0 6px;
  border: 1px solid rgba(200,160,82,0.12);
}

.fortune-bar {
  height: 100%;
  border-radius: 2px;
  color: #07080c;
  font-size: 0.8rem;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(90deg,
    var(--pearl-a),
    var(--gold),
    var(--pearl-b));
  background-size: 200% 100%;
  animation: pearlShimmer 3s ease infinite;
  transition: width 1s ease;
}

.fortune-label { font-size: 0.8rem; color: var(--text-dim); }

.result-disclaimer {
  margin-top: 20px;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.result-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-top: 22px;
  flex-wrap: wrap;
}

/* ── Types Grid ── */
.types-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 28px;
}

.type-card {
  background: var(--lacquer-card);
  border-radius: 4px;
  padding: 26px 20px;
  border: 1px solid rgba(200,160,82,0.18);
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
}

/* 호버 시 자개빛 shimmer */
.type-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg,
    transparent 40%,
    rgba(136,200,216,0.04) 60%,
    rgba(200,160,82,0.04) 80%,
    transparent 100%);
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.type-card:hover {
  transform: translateY(-4px);
  border-color: rgba(200,160,82,0.4);
  box-shadow: 0 12px 32px rgba(0,0,0,0.4), 0 0 20px rgba(200,160,82,0.08);
}
.type-card:hover::before { opacity: 1; }

.type-emoji { font-size: 2.2rem; margin-bottom: 12px; }

.type-card h3 {
  color: var(--gold-light);
  font-size: 1.05rem;
  margin-bottom: 8px;
  letter-spacing: 0.03em;
}

.type-ko {
  display: block;
  font-size: 0.82rem;
  color: var(--text-dim);
  font-weight: 300;
  margin-top: 2px;
}

.type-card p { font-size: 0.86rem; line-height: 1.65; }

@media (max-width: 768px) { .types-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 500px)  { .types-grid { grid-template-columns: 1fr; } }

/* ── Knowledge Grid ── */
.knowledge-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
  margin-top: 20px;
}

.knowledge-card {
  background: var(--lacquer-card);
  border-radius: 4px;
  padding: 26px;
  border: 1px solid rgba(200,160,82,0.14);
  box-shadow: inset 0 1px 0 rgba(200,160,82,0.05);
}

.knowledge-card h4 {
  color: var(--gold-light);
  font-size: 1rem;
  margin-bottom: 12px;
  letter-spacing: 0.03em;
}

@media (max-width: 600px) { .knowledge-grid { grid-template-columns: 1fr; } }

.disclaimer-box {
  margin-top: 36px;
  padding: 20px 24px;
  background: rgba(200,160,82,0.04);
  border-radius: 4px;
  border-left: 3px solid var(--gold-dim);
  border: 1px solid rgba(200,160,82,0.15);
  border-left: 3px solid var(--gold);
}

.disclaimer-box p { font-size: 0.9rem; margin: 0; }

/* ── FAQ ── */
.faq-list { max-width: 700px; margin: 28px auto 0; }

.faq-item {
  background: var(--lacquer-card);
  border-radius: 4px;
  margin-bottom: 10px;
  border: 1px solid rgba(200,160,82,0.15);
  overflow: hidden;
}

.faq-item summary {
  padding: 18px 22px;
  color: var(--text-cream);
  font-weight: 500;
  cursor: pointer;
  font-size: 0.97rem;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  letter-spacing: 0.02em;
  transition: background 0.2s;
}
.faq-item summary:hover { background: rgba(200,160,82,0.04); }

.faq-item summary::after {
  content: '+';
  font-size: 1.3rem;
  color: var(--gold);
  transition: transform 0.2s;
  flex-shrink: 0;
}
.faq-item[open] summary::after { content: '−'; }

.faq-item p {
  padding: 0 22px 18px;
  font-size: 0.93rem;
  border-top: 1px solid rgba(200,160,82,0.08);
  padding-top: 14px;
}

/* ── Footer ── */
.site-footer {
  background: var(--lacquer-panel);
  border-top: 1px solid var(--border-gold);
  padding: 48px 20px 24px;
}

/* 자개빛 상단 장식선 */
.site-footer::before {
  content: '';
  display: block;
  height: 1px;
  background: linear-gradient(90deg,
    transparent,
    var(--pearl-a) 20%,
    var(--gold-light) 40%,
    var(--pearl-b) 60%,
    var(--pearl-d) 80%,
    transparent);
  opacity: 0.4;
  margin-bottom: 48px;
  margin-top: -48px;
}

.footer-inner {
  max-width: 900px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 28px;
}

.footer-col h4 {
  color: var(--gold-light);
  font-size: 0.95rem;
  margin-bottom: 14px;
  letter-spacing: 0.04em;
}

.footer-col p,
.footer-col a {
  color: var(--text-dim);
  font-size: 0.84rem;
  line-height: 1.7;
  text-decoration: none;
  transition: color 0.2s;
}

.footer-col a:hover { color: var(--gold); }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 7px; }

.footer-bottom {
  max-width: 900px;
  margin: 28px auto 0;
  padding-top: 18px;
  border-top: 1px solid rgba(200,160,82,0.12);
  text-align: center;
}

.footer-bottom p { color: var(--text-dim); font-size: 0.78rem; }

@media (max-width: 600px) { .footer-inner { grid-template-columns: repeat(2, 1fr); } }

/* ── Legal Pages ── */
.legal-page { padding-top: 100px; }

.legal-page h1 {
  color: var(--gold-light);
  font-size: 2rem;
  margin-bottom: 8px;
  text-align: center;
  letter-spacing: 0.04em;
}

.legal-date {
  text-align: center;
  color: var(--text-dim);
  margin-bottom: 36px;
}

.legal-page h2 {
  color: var(--gold-light);
  text-align: left;
  font-size: 1.25rem;
  margin-top: 30px;
  margin-bottom: 14px;
  letter-spacing: 0.03em;
}

.legal-page h3 {
  color: var(--text-cream);
  font-size: 1.02rem;
  margin-top: 18px;
}

.legal-page ul {
  margin: 8px 0 8px 24px;
  color: var(--text-mid);
  font-size: 0.93rem;
  line-height: 1.9;
}

.legal-page a { color: var(--gold); }

/* ── Mobile ── */
@media (max-width: 500px) {
  .container { padding: 30px 18px; }
  h1 { font-size: 1.9rem; }
  .hero-section { min-height: 65vh; padding-top: 84px; }
  .btn { padding: 12px 30px; font-size: 0.97rem; }
}
