/* ============================================================
   룸메이커 — 디자인 시스템
   무드: 낡은 가죽 다이어리, 오래된 지도, 촛불, 자물쇠와 열쇠
   ============================================================ */

:root {
  /* 컬러 토큰 */
  --bg-deep: #1c130d;
  --bg-mid: #2b1d13;
  --bg-card: #3a2a1c;
  --gold: #c9a227;
  --gold-light: #e8c766;
  --ivory: #f1e6d2;
  --ivory-dim: #cbb99b;
  --shadow: rgba(0, 0, 0, 0.45);

  /* 타이포 */
  --font-serif: 'Noto Serif KR', 'Nanum Myeongjo', serif;
  --font-sans: 'Noto Sans KR', system-ui, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  background: linear-gradient(175deg, var(--bg-deep) 0%, var(--bg-mid) 55%, var(--bg-deep) 100%);
  color: var(--ivory);
  line-height: 1.7;
}

/* 종이 질감 (SVG 노이즈, 은은하게) */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)'/%3E%3C/svg%3E");
  z-index: 1;
}

/* ---------- 타이포 ---------- */
h1, h2, h3 { font-family: var(--font-serif); font-weight: 700; }

h1 {
  font-size: clamp(2.2rem, 6vw, 3.6rem);
  letter-spacing: 0.12em;
  color: var(--gold-light);
  margin: 0;
}

.section-title {
  font-size: clamp(1.5rem, 3.5vw, 2.1rem);
  letter-spacing: 0.1em;
  color: var(--gold-light);
  text-align: center;
  margin: 0 0 0.6rem;
}

.section-sub {
  text-align: center;
  color: var(--ivory-dim);
  margin: 0 auto 3rem;
  max-width: 560px;
  font-size: 0.98rem;
}

/* 제목 아래 열쇠 장식 구분 */
.section-title::after {
  content: '';
  display: block;
  width: 64px;
  height: 1px;
  margin: 1rem auto 0;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

/* ---------- 레이아웃 ---------- */
.section {
  position: relative;
  max-width: 1080px;
  margin: 0 auto;
  padding: 5.5rem 1.5rem;
  z-index: 2;
}

.section + .section {
  border-top: 1px solid rgba(201, 162, 39, 0.15);
}

/* ---------- 네비게이션 ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(28, 19, 13, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(201, 162, 39, 0.25);
}

.nav-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0.8rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nav-logo {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  letter-spacing: 0.15em;
  color: var(--gold-light);
  text-decoration: none;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.nav-mark { width: 22px; height: 22px; }

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2rem 1.1rem;
  justify-content: flex-end;
}

.nav-links a {
  color: var(--ivory-dim);
  text-decoration: none;
  font-size: 0.86rem;
  transition: color 0.25s;
}

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

/* ---------- 히어로 ---------- */
.hero {
  min-height: 88vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 4rem 1.5rem;
  position: relative;
  z-index: 2;
}

.hero .keyhole {
  font-size: 2.4rem;
  color: var(--gold);
  margin-bottom: 1.2rem;
  animation: flicker 4s ease-in-out infinite;
}

.hero-badge {
  width: min(360px, 72vw);
  filter: drop-shadow(0 0 40px rgba(201, 162, 39, 0.25));
  animation: flicker 6s ease-in-out infinite;
}

@keyframes flicker {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.65; }
}

.hero p.tagline {
  color: var(--ivory-dim);
  max-width: 520px;
  margin: 1.4rem auto 2.4rem;
  font-size: 1.05rem;
}

/* ---------- 버튼 ---------- */
.btn {
  display: inline-block;
  padding: 0.85rem 2.2rem;
  font-family: var(--font-serif);
  font-size: 1rem;
  letter-spacing: 0.08em;
  color: var(--gold-light);
  background: transparent;
  border: 1px solid var(--gold);
  border-radius: 2px;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.3s, color 0.3s, box-shadow 0.3s;
}

.btn:hover {
  background: var(--gold);
  color: var(--bg-deep);
  box-shadow: 0 0 24px rgba(201, 162, 39, 0.35);
}

.btn--solid {
  background: var(--gold);
  color: var(--bg-deep);
}

.btn--solid:hover {
  background: var(--gold-light);
}

/* ---------- 카드 ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}

.card {
  background: linear-gradient(160deg, var(--bg-card), #2f2115);
  border: 1px solid rgba(201, 162, 39, 0.3);
  border-radius: 4px;
  padding: 1.6rem;
  box-shadow: 0 6px 18px var(--shadow);
  transition: transform 0.3s, border-color 0.3s;
  color: var(--ivory);
  text-decoration: none;
  display: flex;
  flex-direction: column;
}

.card:hover {
  transform: translateY(-4px);
  border-color: var(--gold);
}

.card h3 {
  margin: 0 0 0.6rem;
  font-size: 1.15rem;
  color: var(--gold-light);
  letter-spacing: 0.05em;
}

.card p {
  margin: 0;
  color: var(--ivory-dim);
  font-size: 0.92rem;
  flex: 1;
}

.card .card-tag {
  display: inline-block;
  align-self: flex-start;
  margin-bottom: 0.8rem;
  padding: 0.15rem 0.7rem;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--gold);
  border: 1px solid rgba(201, 162, 39, 0.4);
  border-radius: 2px;
}

.card .card-cta {
  margin-top: 1.2rem;
  font-size: 0.85rem;
  color: var(--gold);
  font-family: var(--font-serif);
  letter-spacing: 0.06em;
}

/* 썸네일 자리 */
.card .thumb {
  aspect-ratio: 16 / 9;
  margin: -1.6rem -1.6rem 1.2rem;
  background: linear-gradient(135deg, #241810, #3a2a1c);
  border-bottom: 1px solid rgba(201, 162, 39, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(201, 162, 39, 0.4);
  font-size: 2rem;
}

/* ---------- 폼 ---------- */
.form {
  max-width: 620px;
  margin: 0 auto;
  display: grid;
  gap: 1.1rem;
}

.form label {
  display: block;
  font-size: 0.88rem;
  color: var(--gold-light);
  margin-bottom: 0.4rem;
  letter-spacing: 0.05em;
}

.form input,
.form select,
.form textarea {
  width: 100%;
  padding: 0.75rem 0.9rem;
  background: rgba(28, 19, 13, 0.7);
  border: 1px solid rgba(201, 162, 39, 0.35);
  border-radius: 2px;
  color: var(--ivory);
  font-family: var(--font-sans);
  font-size: 0.95rem;
}

.form input:focus,
.form select:focus,
.form textarea:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 12px rgba(201, 162, 39, 0.25);
}

/* ---------- 스크롤 리빌 (자물쇠 열리듯 은근하게) ---------- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.unlocked {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero .keyhole { animation: none; }
}

/* ---------- 안내 박스 (준비 중 등) ---------- */
.notice {
  text-align: center;
  padding: 2.5rem 1.5rem;
  border: 1px dashed rgba(201, 162, 39, 0.35);
  border-radius: 4px;
  color: var(--ivory-dim);
  font-size: 0.95rem;
}

/* ---------- 진행 바 (책 작업) ---------- */
.progress {
  height: 8px;
  background: rgba(201, 162, 39, 0.15);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 0.6rem;
}

.progress > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--gold), var(--gold-light));
}

/* ---------- 푸터 ---------- */
.footer {
  border-top: 1px solid rgba(201, 162, 39, 0.25);
  text-align: center;
  padding: 3rem 1.5rem 2.5rem;
  color: var(--ivory-dim);
  font-size: 0.85rem;
  position: relative;
  z-index: 2;
}

.footer .sns {
  margin-bottom: 1rem;
  display: flex;
  gap: 1.5rem;
  justify-content: center;
}

.footer .sns a {
  color: var(--gold);
  text-decoration: none;
  letter-spacing: 0.05em;
}

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

.admin-link {
  color: rgba(203, 185, 155, 0.45);
  text-decoration: none;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
}

.admin-link:hover { color: var(--gold-light); }

/* ---------- 상세페이지 전용 ---------- */
.detail-hero {
  text-align: center;
  padding: 5rem 1.5rem 3rem;
  position: relative;
  z-index: 2;
}

.detail-hero .back {
  display: inline-block;
  margin-bottom: 2rem;
  color: var(--ivory-dim);
  text-decoration: none;
  font-size: 0.88rem;
}

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

.detail-body {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 1.5rem 5rem;
  position: relative;
  z-index: 2;
}

.detail-body h2 {
  color: var(--gold-light);
  font-size: 1.4rem;
  letter-spacing: 0.08em;
  margin-top: 3rem;
}

.screenshot-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0;
}

.screenshot-row .shot {
  aspect-ratio: 16 / 10;
  background: linear-gradient(135deg, #241810, #3a2a1c);
  border: 1px solid rgba(201, 162, 39, 0.3);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(201, 162, 39, 0.4);
}

.buy-box {
  margin-top: 4rem;
  text-align: center;
  padding: 3rem 1.5rem;
  border: 1px solid rgba(201, 162, 39, 0.4);
  border-radius: 4px;
  background: rgba(58, 42, 28, 0.5);
}

/* ---------- 반응형 ---------- */
@media (max-width: 640px) {
  .nav-links { font-size: 0.8rem; }
  .section { padding: 4rem 1.25rem; }
}
