/* 꿈갈피 — 공용 스타일시트 */

:root {
  --bg-navy: #101226;
  --bg-ink: #1b1d33;
  --bg-ink-soft: #20223c;
  --text-primary: #ede9f7;
  --text-secondary: #c9c4de;
  --gold: #c9a876;
  --gold-light: #e4cfa0;
  --border-soft: rgba(201, 196, 222, 0.14);
  --shadow-deep: 0 20px 60px rgba(0, 0, 0, 0.45);
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 9px;
  --font-serif: "Noto Serif KR", serif;
  --font-sans: "Noto Sans KR", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: radial-gradient(ellipse at top, #171933 0%, var(--bg-navy) 55%, #0b0c1a 100%);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.7;
  min-height: 100vh;
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
  margin: 0 0 0.6em;
}

p {
  margin: 0 0 1em;
  color: var(--text-secondary);
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
}

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- 헤더 ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(16, 18, 38, 0.96);
  border-bottom: 1px solid var(--border-soft);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--gold-light);
  letter-spacing: 0.02em;
}

.logo::before {
  content: "☾ ";
  color: var(--gold);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-links a {
  color: var(--text-secondary);
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--gold-light);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  padding: 10px 22px;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gold-light), var(--gold));
  color: #201a0d;
}

.btn-primary:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  border-color: var(--border-soft);
  color: var(--text-secondary);
}

.btn-ghost:hover {
  border-color: var(--gold);
  color: var(--gold-light);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  color: var(--text-primary);
  width: 40px;
  height: 40px;
  font-size: 1.2rem;
  cursor: pointer;
}

/* ---------- 히어로 ---------- */

.hero {
  position: relative;
  overflow: hidden;
  padding: 96px 0 72px;
  text-align: center;
  isolation: isolate;
}

.hero-stars {
  position: absolute;
  inset: 0;
  z-index: -2;
  background-image:
    radial-gradient(1.5px 1.5px at 20% 30%, rgba(237,233,247,0.5), transparent),
    radial-gradient(1.5px 1.5px at 70% 20%, rgba(237,233,247,0.4), transparent),
    radial-gradient(1px 1px at 40% 70%, rgba(237,233,247,0.35), transparent),
    radial-gradient(1.5px 1.5px at 85% 60%, rgba(237,233,247,0.4), transparent),
    radial-gradient(1px 1px at 55% 45%, rgba(237,233,247,0.3), transparent),
    radial-gradient(1.5px 1.5px at 10% 80%, rgba(237,233,247,0.35), transparent);
  background-size: 100% 100%;
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 2.9rem);
  max-width: 720px;
  margin: 0 auto 0.5em;
}

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

.hero p.lead {
  max-width: 520px;
  margin: 0 auto 2em;
  font-size: 1.05rem;
}

.hero-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
}

/* 떠다니는 꿈 카드 조각 (장식용) */

.drift-layer {
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.drift-card {
  position: absolute;
  width: 150px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: rgba(27, 29, 51, 0.55);
  border: 1px solid rgba(201, 168, 118, 0.18);
  color: var(--text-secondary);
  font-size: 0.72rem;
  line-height: 1.5;
  filter: blur(0.4px);
  opacity: 0.38;
  animation: drift 34s ease-in-out infinite;
}

.drift-card b {
  display: block;
  color: var(--gold-light);
  font-family: var(--font-serif);
  font-size: 0.78rem;
  margin-bottom: 4px;
  opacity: 0.9;
}

.drift-card.d1 { top: 8%;  left: 6%;   animation-duration: 38s; }
.drift-card.d2 { top: 14%; right: 8%;  animation-duration: 44s; animation-delay: -6s; }
.drift-card.d3 { top: 58%; left: 3%;   animation-duration: 40s; animation-delay: -18s; }
.drift-card.d4 { top: 64%; right: 4%;  animation-duration: 46s; animation-delay: -10s; }
.drift-card.d5 { top: 82%; left: 42%;  animation-duration: 50s; animation-delay: -24s; opacity: 0.2; }

@keyframes drift {
  0%   { transform: translate(0, 0) rotate(-1deg); }
  25%  { transform: translate(14px, -18px) rotate(1deg); }
  50%  { transform: translate(-6px, 10px) rotate(-2deg); }
  75%  { transform: translate(-16px, -8px) rotate(1.5deg); }
  100% { transform: translate(0, 0) rotate(-1deg); }
}

@media (prefers-reduced-motion: reduce) {
  .drift-card {
    animation: none !important;
  }
}

@media (max-width: 768px) {
  .drift-layer {
    display: none;
  }
}

/* ---------- 카테고리 칩 ---------- */

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin: 0 auto 8px;
  max-width: 760px;
}

.chip {
  border: 1px solid var(--border-soft);
  background: var(--bg-ink-soft);
  color: var(--text-secondary);
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 0.86rem;
  transition: all 0.2s ease;
}

.chip:hover {
  border-color: var(--gold);
  color: var(--gold-light);
  transform: translateY(-1px);
}

/* ---------- 섹션 공통 ---------- */

.section {
  padding: 64px 0;
}

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 8px;
}

.section-head h2 {
  font-size: 1.5rem;
}

.section-head .more {
  font-size: 0.88rem;
  color: var(--gold-light);
}

/* ---------- 꿈 카드 그리드 ---------- */

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.dream-card {
  display: flex;
  flex-direction: column;
  background: linear-gradient(160deg, var(--bg-ink) 0%, rgba(27,29,51,0.6) 100%);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 22px;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.dream-card:hover {
  transform: translateY(-4px);
  border-color: rgba(201, 168, 118, 0.4);
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.tag {
  display: inline-block;
  font-size: 0.75rem;
  color: var(--gold-light);
  background: rgba(201, 168, 118, 0.12);
  border: 1px solid rgba(201, 168, 118, 0.28);
  padding: 3px 11px;
  border-radius: 999px;
}

.emo {
  font-size: 1.15rem;
}

.dream-card h3 {
  font-size: 1.08rem;
  margin-bottom: 8px;
}

.dream-card .excerpt {
  font-size: 0.92rem;
  color: var(--text-secondary);
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  color: rgba(201, 196, 222, 0.6);
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border-soft);
}

/* ---------- 아티클(카테고리 설명) ---------- */

.article-box {
  background: var(--bg-ink);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 40px;
  margin-bottom: 48px;
}

.article-box h1 {
  font-size: 1.9rem;
  margin-bottom: 0.3em;
}

.article-box .kicker {
  color: var(--gold-light);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 10px;
  display: block;
}

.article-box p {
  color: var(--text-secondary);
  font-size: 0.98rem;
}

.article-box p + h3 {
  margin-top: 1.4em;
}

.article-box h3 {
  font-size: 1.1rem;
  color: var(--gold-light);
}

/* ---------- 카테고리 그리드(소개) ---------- */

.cat-index-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  margin-bottom: 8px;
}

.cat-index-grid a {
  text-align: center;
  padding: 16px 8px;
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  background: var(--bg-ink-soft);
  font-size: 0.88rem;
  color: var(--text-secondary);
  transition: all 0.2s ease;
}

.cat-index-grid a:hover {
  border-color: var(--gold);
  color: var(--gold-light);
}

/* ---------- 상세 페이지 ---------- */

.detail-box {
  background: var(--bg-ink);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 44px;
}

.detail-tags {
  display: flex;
  gap: 8px;
  margin-bottom: 16px;
}

.detail-box h1 {
  font-size: 1.7rem;
}

.detail-meta {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 0.86rem;
  color: rgba(201, 196, 222, 0.65);
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border-soft);
}

.detail-body {
  font-size: 1.02rem;
  color: var(--text-primary);
  white-space: pre-line;
}

.similar-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 20px;
}

/* ---------- 폼 (제출 페이지) ---------- */

.notice-box {
  background: rgba(201, 168, 118, 0.08);
  border: 1px solid rgba(201, 168, 118, 0.28);
  border-radius: var(--radius-md);
  padding: 24px 28px;
  margin-bottom: 32px;
}

.notice-box h3 {
  color: var(--gold-light);
  font-size: 1.02rem;
}

.notice-box ol {
  margin: 0;
  padding-left: 1.2em;
  color: var(--text-secondary);
  font-size: 0.94rem;
}

.notice-box li {
  margin-bottom: 6px;
}

.form-box {
  background: var(--bg-ink);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 40px;
}

.field {
  margin-bottom: 24px;
}

.field label {
  display: block;
  font-size: 0.92rem;
  color: var(--gold-light);
  margin-bottom: 8px;
  font-weight: 600;
}

.field .hint {
  font-size: 0.8rem;
  color: rgba(201, 196, 222, 0.6);
  margin-top: 6px;
}

input[type="text"],
textarea,
select {
  width: 100%;
  background: var(--bg-navy);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  padding: 13px 16px;
  font-family: var(--font-sans);
  font-size: 0.96rem;
  transition: border-color 0.2s ease;
}

textarea {
  resize: vertical;
  min-height: 200px;
  line-height: 1.7;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--gold);
}

.field-error {
  font-size: 0.82rem;
  color: #e08a8a;
  margin-top: 6px;
  min-height: 1em;
}

.field-ok {
  font-size: 0.82rem;
  color: #8fd0a5;
  margin-top: 6px;
  min-height: 1em;
}

.field-info {
  font-size: 0.82rem;
  color: var(--gold-light);
  margin-top: 6px;
  min-height: 1em;
}

.status-badge {
  display: inline-block;
  font-size: 0.72rem;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid;
}

.status-badge.pending {
  color: var(--gold-light);
  border-color: rgba(201, 168, 118, 0.4);
  background: rgba(201, 168, 118, 0.1);
}

.status-badge.published {
  color: #8fd0a5;
  border-color: rgba(143, 208, 165, 0.4);
  background: rgba(143, 208, 165, 0.1);
}

.pre-submit-note {
  font-size: 0.84rem;
  color: rgba(201, 196, 222, 0.6);
  margin: 4px 0 20px;
}

.form-status {
  margin-top: 18px;
  font-size: 0.92rem;
}

/* ---------- 정적 문서 페이지 ---------- */

.doc-box {
  background: var(--bg-ink);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  padding: 44px;
}

.doc-box h2 {
  font-size: 1.15rem;
  color: var(--gold-light);
  margin-top: 1.6em;
}

.doc-box p, .doc-box li {
  color: var(--text-secondary);
  font-size: 0.96rem;
}

/* ---------- 푸터 ---------- */

.site-footer {
  border-top: 1px solid var(--border-soft);
  padding: 40px 0;
  margin-top: 60px;
}

.site-footer .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-links a {
  font-size: 0.85rem;
  color: rgba(201, 196, 222, 0.65);
}

.footer-links a:hover {
  color: var(--gold-light);
}

.copyright {
  font-size: 0.82rem;
  color: rgba(201, 196, 222, 0.45);
}

/* ---------- 반응형 ---------- */

@media (max-width: 860px) {
  .card-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .cat-index-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .similar-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .nav-links {
    position: absolute;
    top: 72px;
    left: 0;
    right: 0;
    background: var(--bg-ink);
    border-bottom: 1px solid var(--border-soft);
    flex-direction: column;
    align-items: flex-start;
    padding: 16px 24px 24px;
    gap: 16px;
    display: none;
  }
  .nav-links.open {
    display: flex;
  }
  .nav-toggle {
    display: block;
  }
  .card-grid {
    grid-template-columns: 1fr;
  }
  .cat-index-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .article-box, .detail-box, .form-box, .doc-box {
    padding: 26px;
  }
  .hero {
    padding: 64px 0 48px;
  }
}
