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

:root {
  --bg: #f1f1ef;
  --paper: #ffffff;
  --text: #1c1c1b;
  --muted: #858581;
  --line: #e5e5e1;
  --tile: #d7d7d4;
  --accent: #292927;
  --max-width: 520px;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: "Noto Sans KR", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  width: min(100%, var(--max-width));
  min-height: 100vh;
  margin: 0 auto;
  background: var(--paper);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  min-height: 64px;
  padding: 0 18px;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(0, 0, 0, .045);
}

.site-header h1 {
  margin: 0;
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -.025em;
}

.back-button {
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  visibility: hidden;
}

.back-button.visible {
  visibility: visible;
}

.header-spacer {
  width: 36px;
}

.view {
  padding: 28px 22px 56px;
}

.intro {
  padding: 12px 4px 28px;
}

.eyebrow {
  margin: 0 0 8px;
  color: #9a9a95;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .15em;
}

.intro-copy {
  margin: 0;
  font-size: 13px;
  line-height: 1.8;
  letter-spacing: -.03em;
}

.song-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px 18px;
}

.song-card {
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.song-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: var(--tile);
}

.song-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.song-thumb::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(145deg, rgba(255, 255, 255, .13), rgba(0, 0, 0, .08));
}

.detail-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.song-thumb span {
  position: absolute;
  z-index: 1;
  left: 10px;
  bottom: 9px;
  color: rgba(255, 255, 255, .95);
  font-family: "Playfair Display", serif;
  font-size: 13px;
}

.song-card:nth-child(3n+1) .song-thumb {
  background: #c8c8c5;
}

.song-card:nth-child(3n+2) .song-thumb {
  background: #bcbcb8;
}

.song-card:nth-child(3n) .song-thumb {
  background: #d1d1ce;
}

.song-meta {
  padding-top: 10px;
}

.song-title {
  margin: 0;
  overflow: hidden;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.45;
  letter-spacing: -.03em;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.song-artist {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.song-original {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.detail-view {
  height: calc(100dvh - 64px);
  padding: 0;
  overflow: hidden;
}

.detail-view > #detailContent {
  height: 100%;
  min-height: 0;
}

/* 상세 페이지 전체 */
.detail {
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  max-width: 390px;
  margin: 0 auto;
}

/* 상단 고정 영역 */
.detail-hero {
  flex: 0 0 auto;
  padding: 10px 0 16px;
  background: #fff;
  text-align: center;
}

/* 릴스 이미지 */
.detail-thumb {
  width: min(60vw, 250px);
  aspect-ratio: 3 / 4;
  margin: 0 auto;
  overflow: hidden;
  position: relative;
  background: #c8c8c5;
}

.detail-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

/* 제목 */
.detail-title {
  margin: 12px 0 0;
  text-align: center;
  font-size: 12px;
  font-weight: 500;
  color: #777773;
  line-height: 1.6;
}

/* 가사 영역 */
.lyrics-panel {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
}

/* 스크롤바 */
.lyrics-panel::-webkit-scrollbar {
  width: 4px;
}

.lyrics-panel::-webkit-scrollbar-thumb {
  background: #d5d5d2;
  border-radius: 5px;
}

.lyrics {
  margin: 0;
  padding: 0;
  font-size: 13px;
  line-height: 1.75;
  letter-spacing: -.025em;
  white-space: pre-line;
}

.lyrics-heading {
  margin: 0 0 5px;
  font-size: 10px;
  color: #aaa9a4;
  font-weight: 700;
  letter-spacing: .12em;
}

.lyrics p {
  margin: 0;
}

.source-note {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: #9a9994;
  font-size: 10px;
  line-height: 1.6;
}


.reel-link {
  display: block;
  color: inherit;
  text-decoration: none;
}



.detail-thumb::after {
  position: absolute;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, .9);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .16em;
}

.detail-thumb .thumb-mark {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, .96);
  font-family: "Playfair Display", serif;
  font-size: clamp(28px, 8vw, 44px);
  text-align: center;
  line-height: 1.05;
  padding: 3px;
}



.empty {
  padding: 6px 0;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

@media (min-width: 521px) {
  body {
    padding: 24px 0;
  }

  .app-shell {
    min-height: calc(100vh - 48px);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .04);
  }
}