/* SongDex 토큰(jyp-developers/songdex app/src/tokens.css)에서 가져온 값 */
:root {
  --bg: #ffffff;
  --bg-soft: #f8f8f9;
  --bg-muted: #f3f3f4;
  --line: #e9eaec;
  --text: #191919;
  --text-2: #5f6064;
  --text-3: #6e6f73;
  --muted: #d8d9db;
  --quat: #bfbfbf;
  --primary: #009be6;
  --primary-ink: #007bb8;
  --primary-ink-hover: #00669a;
  --primary-soft: #edf9ff;
  /* 구간 색: SongDex 파형과 같은 값 */
  --pt-intro: #bfbfbf;
  --pt-verse: #009be7;
  --pt-pre: #10b981;
  --pt-chorus: #009be6;
  --pt-bridge: #8b5cf6;
  --pt-inter: #f59e0b;
  --radius-sm: 4px;
  --radius-lg: 8px;
  --shadow: 0 0 2px rgba(0, 0, 0, .06), 0 2px 8px rgba(0, 0, 0, .12);
  --font: Pretendard, -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
  --gutter: 16px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.6 var(--font);
  word-break: keep-all;
  overflow-wrap: break-word;
  font-variant-numeric: tabular-nums;
}
::selection { background: var(--primary-ink); color: #fff; }
h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
img { display: block; }
a { color: var(--primary-ink); text-underline-offset: 3px; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; border-radius: var(--radius-sm); }

.br-wide { display: none; }
.wrap { width: 100%; max-width: 1160px; margin: 0 auto; padding: 0 var(--gutter); }
.num { font-variant-numeric: tabular-nums; }

/* 버튼 */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 22px;
  background: var(--primary-ink); color: #fff;
  font-weight: 700; font-size: 16px; text-decoration: none;
  border-radius: var(--radius-lg);
  transition: background-color .15s ease, transform .15s ease;
}
.btn:hover { background: var(--primary-ink-hover); }
.btn:active { transform: translateY(1px); }
.btn--sm { min-height: 36px; padding: 0 14px; font-size: 14px; background: #fff; color: var(--primary-ink); box-shadow: inset 0 0 0 1px rgba(0, 123, 184, .4); }
.btn--sm:hover { background: var(--primary-soft); color: var(--primary-ink-hover); }
.btn--lg { min-height: 56px; padding: 0 32px; font-size: 17px; }

/* 머리 */
.top {
  position: sticky; top: 0; z-index: 10;
  background: rgba(255, 255, 255, .92);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease;
}
.top.is-scrolled { border-bottom-color: var(--line); }
.top__in { display: flex; align-items: center; justify-content: space-between; height: 60px; }
.logo img { width: 96px; height: auto; }

/* 첫 화면 */
.hero { padding-top: 28px; padding-bottom: 8px; }
.hero h1 {
  font-size: clamp(28px, 8.2vw, 52px);
  line-height: 1.28;
  font-weight: 800;
  letter-spacing: -.03em;
  text-wrap: balance;
}
.lead { margin-top: 14px; font-size: 16px; color: var(--text-2); max-width: 34em; }
.cta { margin-top: 22px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.cta__note { font-size: 13px; color: var(--text-3); }

.sample {
  font-size: 11px; font-weight: 600; letter-spacing: .02em; line-height: 1.6;
  color: var(--text-3); background: var(--bg-muted);
  padding: 1px 6px; border-radius: var(--radius-sm);
}
.sample-note { margin-top: 12px; font-size: 12px; color: var(--text-3); }

/* 예시 곡 카드 */
.card {
  margin-top: 30px;
  margin-left: calc(var(--gutter) * -1);
  margin-right: calc(var(--gutter) * -1);
  padding: 14px var(--gutter) 18px;
  border-top: 1px solid var(--text);
}
.card__head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.card__head strong { font-size: 18px; font-weight: 700; }
.card__by { font-size: 13px; color: var(--text-3); }

.player { margin-top: 14px; }
.parts { position: relative; height: 26px; }
.part {
  position: absolute; top: 0; height: 24px; min-width: 0;
  padding: 0 5px 0 3px; border: 0; border-radius: 2px; background: none;
  font-size: 11px; line-height: 20px; color: var(--text-3);
  text-align: left; white-space: nowrap; overflow: hidden; cursor: pointer;
}
.part::before {
  content: ""; position: absolute; left: 0; right: 2px; bottom: 0;
  height: 2px; border-radius: 1px; background: currentColor; opacity: .3;
}
.part:hover, .part.is-cur { color: var(--text); font-weight: 600; }
.part.is-best { box-shadow: inset 0 0 0 1px var(--quat); }
.part.is-short { font-size: 0; }

.wave { display: block; width: 100%; height: 76px; margin-top: 4px; cursor: pointer; touch-action: pan-y; }
.wave svg { display: block; width: 100%; height: 100%; }
.wave rect { fill: var(--muted); transition: fill .15s; }
.wave rect.p.pt-intro, .wave rect.p.pt-outro { fill: var(--pt-intro); }
.wave rect.p.pt-verse { fill: var(--pt-verse); }
.wave rect.p.pt-prechorus { fill: var(--pt-pre); }
.wave rect.p.pt-chorus { fill: var(--pt-chorus); }
.wave rect.p.pt-bridge { fill: var(--pt-bridge); }
.wave rect.p.pt-interlude { fill: var(--pt-inter); }
.wave rect.line { fill: var(--text); }
.wave:focus-visible { outline-offset: 4px; }
.ruler { display: flex; justify-content: space-between; height: 18px; border-top: 1px solid var(--line); font-size: 11px; color: var(--text-3); padding-top: 2px; }

.now { min-height: 76px; margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--bg-muted); }
.now__top { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; font-size: 13px; color: var(--text-2); }
.now__top .first { font-weight: 700; color: var(--text); }
.now__desc { margin-top: 4px; font-size: 15px; }

.ptag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 600; line-height: 1;
  padding: 4px 8px 4px 7px; border-radius: var(--radius-sm);
  background: var(--bg-muted); color: var(--text);
}
.ptag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--dot, var(--quat)); }
.ptag.pt-verse { --dot: var(--pt-verse); }
.ptag.pt-prechorus { --dot: var(--pt-pre); }
.ptag.pt-chorus { --dot: var(--pt-chorus); }
.ptag.pt-bridge { --dot: var(--pt-bridge); }
.ptag.pt-interlude { --dot: var(--pt-inter); }

.stats {
  display: grid; grid-template-columns: repeat(3, 1fr);
  margin-top: 14px; border-top: 1px solid var(--line);
}
.stats div { padding: 10px 0 8px; border-bottom: 1px solid var(--bg-muted); }
.stats dt { font-size: 12px; color: var(--text-3); }
.stats dd { font-size: 18px; font-weight: 700; line-height: 1.4; }
.stats dd small { font-size: 13px; font-weight: 500; color: var(--text-3); }
.card__hint { margin-top: 12px; font-size: 12px; color: var(--text-3); }

/* 섹션 */
section[id] { scroll-margin-top: 76px; }
.sec { padding-top: 56px; padding-bottom: 56px; border-top: 1px solid var(--line); }
.strip {
  display: flex; align-items: center; gap: 1px;
  height: 28px; margin-bottom: 22px; max-width: 360px;
}
.strip i { flex: 1; min-width: 0; background: var(--bg-muted); border-radius: 1px; transition: background-color .6s var(--ease); }
.strip.is-on i.on.pt-intro, .strip.is-on i.on.pt-outro { background: var(--pt-intro); }
.strip.is-on i.on.pt-verse { background: var(--pt-verse); }
.strip.is-on i.on.pt-prechorus { background: var(--pt-pre); }
.strip.is-on i.on.pt-chorus { background: var(--pt-chorus); }
.strip.is-on i.on.pt-bridge { background: var(--pt-bridge); }
.strip.is-on i.on.pt-interlude { background: var(--pt-inter); }
.sec__head h2 {
  font-size: clamp(24px, 6vw, 36px);
  line-height: 1.32; font-weight: 800; letter-spacing: -.025em;
  text-wrap: balance;
}
.sec__head p { margin-top: 12px; color: var(--text-2); max-width: 36em; }
.fl { font-size: 12px; font-weight: 600; color: var(--text-3); }

/* 구간 표 */
.sheet { margin-top: 28px; }
.tbl { width: 100%; border-collapse: collapse; border-top: 1px solid var(--text); font-size: 14px; }
.tbl th { text-align: left; font-size: 12px; font-weight: 600; color: var(--text-3); padding: 9px 8px 7px 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { padding: 10px 8px 10px 0; border-bottom: 1px solid var(--line); vertical-align: top; }
.tbl td:first-child { color: var(--text-3); }
.tbl tr.is-best td { background: var(--bg-soft); font-weight: 600; }
.tbl tr.is-best td:first-child { color: var(--text); padding-left: 6px; }
.sheet .tbl th:nth-child(3), .sheet .tbl td:nth-child(3),
.sheet .tbl th:nth-child(4), .sheet .tbl td:nth-child(4) { display: none; }
.tags { margin-top: 18px; display: grid; gap: 10px; }
.tags__row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tags__row .fl { width: 64px; flex: none; }
.tag { font-size: 13px; padding: 3px 9px; border-radius: 999px; border: 1px solid var(--line); }
.tag--soft { background: var(--bg-soft); color: var(--text-2); }

/* 곡 찾기 */
.find { margin-top: 28px; }
.addr {
  display: flex; flex-wrap: wrap; font-size: 13px;
  padding: 10px 12px; border-radius: var(--radius-lg); background: var(--bg-muted);
  overflow-wrap: anywhere;
}
.addr__host { color: var(--text-3); }
.addr__q { color: var(--primary-ink-hover); font-weight: 600; }
.facets { margin-top: 16px; display: grid; gap: 10px; }
.facet { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.facet .fl { width: 44px; flex: none; }
.chip {
  font-size: 13px; padding: 4px 10px; border-radius: 999px; min-height: 30px;
  border: 1px solid var(--line); background: #fff; color: var(--text-2); cursor: pointer;
  transition: background-color .15s ease, border-color .15s ease;
}
.chip:hover { border-color: var(--quat); color: var(--text); }
.chip[aria-pressed="true"] { background: var(--primary-soft); border-color: rgba(0, 155, 230, .45); color: #006a9f; font-weight: 600; }
.rows { margin-top: 18px; border-top: 1px solid var(--text); }
.rows li {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 14px;
}
.rows .empty { color: var(--text-3); font-size: 14px; }
.rows .t { flex: 1; min-width: 0; color: var(--text-3); font-size: 13px; }
.rows .t b { color: var(--text); font-size: 15px; font-weight: 600; margin-right: 6px; }
.rows .n { font-size: 13px; color: var(--text-3); white-space: nowrap; }

/* 비슷한 곡 */
.sim { margin-top: 28px; }
.seg {
  display: inline-flex; flex-wrap: wrap; gap: 2px;
  background: var(--bg-muted); border-radius: var(--radius-lg); padding: 3px;
}
.seg button, .seg span {
  border: 0; background: none; cursor: pointer;
  padding: 6px 11px; border-radius: 6px;
  font-size: 13px; font-weight: 600; color: var(--text-3);
  transition: background-color .15s ease, color .15s ease;
}
.seg button:hover { color: var(--text); }
.seg [aria-selected="true"], .seg [aria-checked="true"], .seg .on { background: #fff; color: var(--text); box-shadow: var(--shadow); }
.sim__hint { margin-top: 12px; font-size: 14px; color: var(--text-2); min-height: 1.6em; }
.sim .rows { margin-top: 12px; }
.rows--rank { counter-reset: r; }
.rows--rank li::before {
  counter-increment: r; content: counter(r);
  width: 16px; flex: none; font-weight: 700; color: var(--text-3); font-size: 13px;
}
.rows .score { font-size: 14px; font-weight: 700; width: 40px; text-align: right; }
.mini {
  flex: none; text-decoration: none; font-size: 12px; font-weight: 700; color: var(--primary-ink);
  padding: 4px 9px; border-radius: 6px; box-shadow: inset 0 0 0 1px rgba(0, 123, 184, .4);
}

/* 곡 비교 */
.cmp { margin-top: 28px; }
.cmp__bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.cmp__rows { margin-top: 14px; position: relative; }
.crow { padding: 10px 0 4px; }
.crow + .crow { border-top: 1px solid var(--bg-muted); }
.crow__head { display: flex; align-items: baseline; gap: 8px; font-size: 13px; color: var(--text-3); }
.crow__head b { font-size: 15px; color: var(--text); font-weight: 600; }
.lab {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 700; background: var(--primary-soft); color: #006a9f;
  align-self: center;
}
.lab--b { background: #f5f0ff; color: #6d3fd9; }
.cwave { height: 52px; margin-top: 4px; }
.cwave svg { display: block; width: 100%; height: 100%; overflow: visible; }
.cwave g { transition: transform .7s var(--ease); }
.cwave .mark { transition: opacity .3s ease; }
.cwave .pt-intro, .cwave .pt-outro { fill: var(--pt-intro); }
.cwave .pt-verse { fill: var(--pt-verse); }
.cwave .pt-prechorus { fill: var(--pt-pre); }
.cwave .pt-chorus { fill: var(--pt-chorus); }
.cwave .pt-bridge { fill: var(--pt-bridge); }
.cwave .pt-interlude { fill: var(--pt-inter); }
.cmp__grid { margin-top: 22px; display: grid; gap: 24px; }
.cmp__grid h3 { font-size: 15px; font-weight: 700; }
.cmp__grid h3 small { font-size: 12px; font-weight: 500; color: var(--text-3); margin-left: 4px; }
.diff { margin-top: 10px; display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--text); }
.diff div { padding: 10px 0; border-bottom: 1px solid var(--line); }
.diff dt { font-size: 12px; color: var(--text-3); }
.diff dd { font-size: 18px; font-weight: 700; }
.hbars { margin-top: 10px; border-top: 1px solid var(--text); }
.hbars li { display: grid; grid-template-columns: 80px 1fr 44px; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.hbars .b { height: 8px; background: var(--bg-muted); border-radius: 2px; overflow: hidden; }
.hbars .b i { display: block; height: 100%; width: calc(var(--w) * 100%); background: var(--primary); border-radius: 2px; transform-origin: left; }
.hbars .v { text-align: right; font-weight: 600; font-size: 13px; }

/* 레이블 평가 */
.rate { margin-top: 28px; display: grid; gap: 28px; }
.rate__box { border-top: 1px solid var(--text); }
.rate__row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.rate__row .fl { width: 40px; flex: none; }
.score { display: flex; gap: 6px; }
.score button {
  width: 40px; height: 40px; display: grid; place-items: center;
  border: 0; background: #fff; cursor: pointer;
  border-radius: var(--radius-lg); box-shadow: inset 0 0 0 1px var(--line);
  font-weight: 700; color: var(--text-3);
  transition: background-color .15s ease, color .15s ease;
}
.score button:hover { color: var(--text); box-shadow: inset 0 0 0 1px var(--quat); }
.score [aria-checked="true"] { background: var(--primary-ink); color: #fff; box-shadow: none; }
.score [aria-checked="true"]:hover { color: #fff; box-shadow: none; }
.reason { flex: 1; min-width: 0; font-size: 14px; padding: 8px 10px; border-radius: 6px; background: var(--bg-soft); box-shadow: inset 0 0 0 1px var(--line); }
.lift h3 { font-size: 15px; font-weight: 700; }
.rule { margin-top: 4px; font-size: 13px; color: var(--text-2); }
.hbars--lift .b i { background: var(--primary); }
.rate > .sample-note { margin-top: -16px; }

/* 곡 지도, 리포트 */
.duo { margin-top: 28px; display: grid; gap: 24px; }
.duo .col { border-top: 1px solid var(--text); padding-top: 14px; }
.duo h3 { font-size: 17px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.duo p { margin-top: 6px; color: var(--text-2); font-size: 15px; max-width: 34em; }
.badge { font-size: 11px; font-weight: 600; color: var(--text-3); background: var(--bg-muted); padding: 2px 6px; border-radius: var(--radius-sm); }

/* 알아 둘 것 */
.facts { margin-top: 28px; border-top: 1px solid var(--text); }
.facts li { padding: 14px 0; border-bottom: 1px solid var(--line); color: var(--text-2); font-size: 15px; }
.facts b { display: block; color: var(--text); font-size: 16px; margin-bottom: 2px; }

/* 마무리 */
.close {
  padding-top: 72px; padding-bottom: 80px;
  border-top: 1px solid var(--line);
  text-align: center;
}
.strip--close { margin: 0 auto 28px; }
.close h2 { font-size: clamp(28px, 7vw, 44px); line-height: 1.28; font-weight: 800; letter-spacing: -.03em; }
.close p { margin-top: 12px; color: var(--text-2); }
.close .btn { margin-top: 26px; }

.foot { background: var(--bg-soft); padding: 28px 0 36px; font-size: 13px; color: var(--text-3); }
.foot p + p { margin-top: 6px; font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  .strip i, .cwave g, .wave rect { transition: none; }
  html { scroll-behavior: auto; }
}

/* 조금 넓은 휴대폰부터 구간 표 칸을 다 보여 줌 */
@media (min-width: 560px) {
  .sheet .tbl th:nth-child(3), .sheet .tbl td:nth-child(3),
  .sheet .tbl th:nth-child(4), .sheet .tbl td:nth-child(4) { display: table-cell; }
}

/* PC */
@media (min-width: 900px) {
  :root { --gutter: 40px; }
  .top__in { height: 68px; }
  .logo img { width: 112px; }
  .hero {
    display: grid; grid-template-columns: 5fr 7fr; gap: 56px; align-items: center;
    padding-top: 56px; padding-bottom: 72px;
  }
  .br-wide { display: inline; }
  .hero h1 { font-size: clamp(44px, 3.6vw, 52px); }
  .sec__head h2 { font-size: 32px; }
  .close h2 { font-size: 40px; }
  .lead { font-size: 18px; }
  .card { margin: 0; padding: 16px 0 0; }
  .wave { height: 120px; }
  .stats { grid-template-columns: repeat(6, 1fr); }
  .stats div { border-bottom: 0; }
  .sec {
    display: grid; grid-template-columns: 5fr 7fr; column-gap: 56px;
    padding-top: 88px; padding-bottom: 88px;
  }
  .sec__head { grid-column: 1; }
  .sec > :not(.sec__head) { grid-column: 2; margin-top: 0; }
  .cmp__grid { grid-template-columns: 1fr 1fr; gap: 40px; }
  .rate { grid-template-columns: 1fr 1fr; gap: 40px; }
  .rate > .sample-note { grid-column: 1 / -1; margin-top: -24px; }
  .duo { grid-template-columns: 1fr 1fr; gap: 40px; }
  .cwave { height: 64px; }
  .close { padding-top: 112px; padding-bottom: 120px; }
}
