/*
 * LITTLE MUSIC のスタイル。外部ライブラリ・外部フォント不使用。
 *
 * podcast の作法(硬い枠線・角丸なし・影で浮かせる印刷物の感じ)は踏襲しつつ、
 * 色は分ける。podcast が「紙」なら、こちらは「レコードのジャケット」。
 * 同じサイトの別の棚に見えることを狙っている。
 */

:root {
  --sleeve: #1b1a18;      /* ジャケットの地 */
  --sleeve-2: #24231f;
  --label: #f0e9dc;       /* レーベル面の紙 */
  --ink: #f0e9dc;
  --muted: #a29c8e;
  --line: #3d3a33;
  --spot: #e0703a;        /* 差し色(オレンジ) */
  --spot-2: #7fb0a3;      /* 2つめの差し色(青緑) */
  --gold: #d9a928;
  --sans: "Hiragino Sans", "Yu Gothic", "Noto Sans JP", system-ui, sans-serif;
  --mono: "SFMono-Regular", "Menlo", "Consolas", "Noto Sans Mono", monospace;
  --bar-height: 84px;
}

* { box-sizing: border-box; }
html { color-scheme: dark; }

body {
  margin: 0;
  color: var(--ink);
  background:
    repeating-linear-gradient(
      115deg,
      rgba(255, 255, 255, .014) 0 1px,
      transparent 1px 7px
    ),
    var(--sleeve);
  font-family: var(--sans);
  line-height: 1.7;
  /* 固定プレイヤーバーのぶんだけ下を空ける */
  padding-bottom: calc(var(--bar-height) + 1rem);
}

a { color: inherit; text-underline-offset: .2em; }
button, input, select { font: inherit; color: inherit; }

button, .button {
  border: 2px solid var(--ink);
  border-radius: 0;
  background: transparent;
  min-height: 44px;
  padding: .5rem 1rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 3px 3px 0 var(--spot);
  transition: transform .08s, box-shadow .08s;
}
button:hover, .button:hover { transform: translate(1px, 1px); box-shadow: 2px 2px 0 var(--spot); }
button:active { transform: translate(3px, 3px); box-shadow: 0 0 0 var(--spot); }
button[disabled] { opacity: .4; cursor: not-allowed; box-shadow: none; }
button:focus-visible, a:focus-visible, input:focus-visible {
  outline: 3px solid var(--gold);
  outline-offset: 3px;
}

.shell { width: min(1080px, calc(100% - 2rem)); margin-inline: auto; }

/* ---------------------------------------------------------------- ヘッダー */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: 1rem max(1rem, calc((100vw - 1080px) / 2));
  border-bottom: 2px solid var(--line);
  background: var(--sleeve-2);
}
.brand { text-decoration: none; font-weight: 950; letter-spacing: .08em; line-height: 1.1; }
.brand small {
  display: block;
  margin-top: .35rem;
  color: var(--spot);
  font-size: .62rem;
  letter-spacing: .16em;
  font-weight: 700;
}
.site-nav { display: flex; gap: .9rem; font-size: .85rem; font-weight: 800; }
.site-nav a[aria-current="page"] { color: var(--spot); }
#home-link { font-size: .85rem; font-weight: 800; }
#fullscreen-btn {
  min-height: 0; flex-shrink: 0; width: 30px; height: 30px; padding: 0; border: 1px solid var(--line);
  background: transparent; color: var(--ink); font-size: 14px; line-height: 1;
  cursor: pointer; touch-action: manipulation;
}
#fullscreen-btn:hover { border-color: var(--spot); }

/* -------------------------------------------------------------------- hero */

.hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1.5rem;
  align-items: center;
  padding: clamp(2rem, 6vw, 4rem) 0 2rem;
  border-bottom: 2px solid var(--line);
}
.hero h1 {
  margin: 0;
  font-size: clamp(2.4rem, 9vw, 4.6rem);
  line-height: .95;
  letter-spacing: -.02em;
}
.eyebrow {
  margin: 0 0 .6rem;
  color: var(--spot);
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .22em;
}
.hero-copy { margin: 1rem 0 0; max-width: 46ch; color: var(--muted); }

/* 回っているレコード。CSSだけで描く(画像を持たない) */
.disc {
  width: clamp(96px, 22vw, 168px);
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, var(--label) 0 13%, transparent 13.5%),
    radial-gradient(circle at center, var(--sleeve) 0 4%, transparent 4.5%),
    repeating-radial-gradient(circle at center, #2c2a26 0 2px, #201f1c 2px 4px);
  border: 2px solid var(--line);
  animation: spin 6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .disc { animation: none; } }

/* ------------------------------------------------------------------ 曲一覧 */

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin: 2.5rem 0 1rem;
}
.section-head h2 { margin: 0; font-size: 1.1rem; letter-spacing: .12em; }
.section-head .date { color: var(--muted); font-family: var(--mono); font-size: .85rem; }

.tracklist { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }

.track {
  display: grid;
  grid-template-columns: 3rem 1fr auto;
  gap: 1rem;
  align-items: center;
  padding: 1rem .5rem;
  border-bottom: 1px solid var(--line);
}
.track[aria-current="true"] { background: rgba(224, 112, 58, .1); }
.track .no { font-family: var(--mono); color: var(--muted); font-size: .9rem; }
.track .title { margin: 0; font-size: 1.05rem; font-weight: 800; }
.track .title a { text-decoration: none; }
.track .title a:hover { text-decoration: underline; }
.track .meta {
  margin: .2rem 0 0;
  color: var(--muted);
  font-size: .82rem;
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
}
.track .play { min-width: 5.5rem; }

.badge {
  display: inline-block;
  border: 1px solid var(--line);
  padding: 0 .45rem;
  font-family: var(--mono);
  font-size: .72rem;
  letter-spacing: .04em;
  color: var(--muted);
}
.badge.license { color: var(--spot-2); border-color: var(--spot-2); }

/* --------------------------------------------------------- プレイヤーバー */

.player-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  min-height: var(--bar-height);
  display: grid;
  grid-template-columns: 1fr;
  gap: .35rem;
  padding: .55rem max(1rem, calc((100vw - 1080px) / 2));
  background: var(--sleeve-2);
  border-top: 2px solid var(--spot);
}
.player-bar[hidden] { display: none; }
.player-row { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; }
.player-row .now { flex: 1 1 12rem; min-width: 0; }
.player-row .now strong { display: block; font-size: .95rem; }
.player-row .now span { color: var(--muted); font-size: .78rem; }
.player-bar button { min-height: 40px; padding: .3rem .7rem; box-shadow: 2px 2px 0 var(--spot); }
.player-bar .time { font-family: var(--mono); font-size: .78rem; color: var(--muted); white-space: nowrap; }

/*
 * シークバー。波形データ(工程5)があればその上に重ねて描くが、無くても成立する。
 * 波形が無い間は素の進捗バーとして見える。
 */
.seek {
  position: relative;
  height: 34px;
  border: 1px solid var(--line);
  background: #161513;
  cursor: pointer;
  overflow: hidden;
}
.seek canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.seek .progress {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: rgba(224, 112, 58, .28);
  border-right: 2px solid var(--spot);
  pointer-events: none;
}

/* ------------------------------------------------------------------ 曲詳細 */

.detail-head { padding: 2rem 0 1.25rem; border-bottom: 2px solid var(--line); }
.detail-head h1 { margin: .2rem 0 .4rem; font-size: clamp(1.6rem, 5vw, 2.6rem); line-height: 1.1; }
.detail-head .by { margin: 0; color: var(--muted); }

.panel {
  margin: 1.5rem 0;
  border: 1px solid var(--line);
  padding: 1rem 1.1rem;
  background: rgba(255, 255, 255, .02);
}
.panel h2 { margin: 0 0 .75rem; font-size: .82rem; letter-spacing: .18em; color: var(--spot); }

.facts { margin: 0; display: grid; grid-template-columns: 8.5rem 1fr; gap: .4rem 1rem; }
.facts dt { color: var(--muted); font-size: .85rem; }
.facts dd { margin: 0; font-size: .9rem; overflow-wrap: anywhere; }
.facts dd.mono { font-family: var(--mono); font-size: .78rem; }

.bpm-compare { display: flex; gap: 1.5rem; flex-wrap: wrap; align-items: flex-end; }
.bpm-compare div { min-width: 6rem; }
.bpm-compare .value { font-size: 1.8rem; font-weight: 900; line-height: 1; font-family: var(--mono); }
.bpm-compare .caption { color: var(--muted); font-size: .75rem; }

.note { color: var(--muted); font-size: .82rem; margin: .6rem 0 0; }

.empty { padding: 2rem 0; color: var(--muted); }
.error { border-left: 3px solid var(--spot); padding-left: .8rem; }

.site-footer {
  margin-top: 3rem;
  padding: 1.5rem max(1rem, calc((100vw - 1080px) / 2));
  border-top: 2px solid var(--line);
  color: var(--muted);
  font-size: .8rem;
}
.site-footer p { margin: .3rem 0; }

/* ------------------------------------------------------------------ 狭い幅 */

@media (max-width: 560px) {
  .hero { grid-template-columns: 1fr; }
  .disc { justify-self: start; }
  .track { grid-template-columns: 2rem 1fr; }
  .track .play { grid-column: 2; justify-self: start; }
  .facts { grid-template-columns: 1fr; gap: .1rem .5rem; }
  .facts dd { margin-bottom: .5rem; }
}

/* スペクトログラム。曲ごとに事前生成したPNGを貼るだけ */
.spectro {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--line);
  image-rendering: auto;
}

/* ------------------------------------------------- ライセンス表・帰属文・DL */

.license-table { width: 100%; border-collapse: collapse; margin: 0; }
.license-table th,
.license-table td {
  border-bottom: 1px solid var(--line);
  padding: .5rem .3rem;
  text-align: left;
  font-size: .92rem;
}
.license-table th { color: var(--muted); font-weight: 600; width: 60%; }
.license-table td.yes { color: var(--spot-2); font-weight: 800; }
.license-table td.no { color: var(--muted); }
.license-table td.required { color: var(--spot); font-weight: 800; }

.attribution-block { margin: 0 0 1.2rem; }
.attribution-block h3 { margin: 0 0 .4rem; font-size: .78rem; letter-spacing: .1em; color: var(--muted); }
pre.attribution {
  margin: 0 0 .5rem;
  padding: .7rem .8rem;
  border: 1px solid var(--line);
  background: #161513;
  font-family: var(--mono);
  font-size: .78rem;
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  user-select: all;
}
.attribution-block button { min-height: 38px; padding: .25rem .8rem; font-size: .82rem; }

ul.downloads { margin: 0; padding-left: 1.1rem; }
ul.downloads li { margin-bottom: .6rem; }
ul.downloads a { font-weight: 800; }
ul.downloads .note { display: block; margin: 0; }

/* --------------------------------------------------------------- about ページ */

.prose { max-width: 68ch; }
.prose h2 { margin: 2.5rem 0 .8rem; font-size: 1.15rem; letter-spacing: .04em; }
.prose h3 { margin: 1.8rem 0 .5rem; font-size: .95rem; color: var(--spot); }
.prose p, .prose li { font-size: .95rem; }
.prose blockquote {
  margin: .8rem 0;
  padding: .6rem 0 .6rem 1rem;
  border-left: 3px solid var(--spot);
  color: var(--muted);
  font-size: .88rem;
}
.prose table { width: 100%; border-collapse: collapse; margin: 1rem 0; }
.prose th, .prose td {
  border-bottom: 1px solid var(--line);
  padding: .5rem .4rem;
  text-align: left;
  font-size: .88rem;
  vertical-align: top;
}
.prose th { color: var(--muted); font-weight: 700; }
.callout {
  border: 2px solid var(--spot);
  padding: 1rem 1.1rem;
  margin: 1.5rem 0;
}
.callout h2 { margin-top: 0; }

/* --------------------------------------------------------------- 絞り込み */

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: .8rem 1.2rem;
  align-items: flex-end;
  padding: 1rem 0 1.2rem;
  border-bottom: 1px solid var(--line);
}
.filters .field { display: flex; flex-direction: column; gap: .25rem; }
.filters .field[hidden] { display: none; }
.filters label { font-size: .74rem; letter-spacing: .1em; color: var(--muted); }
.filters input[type="search"],
.filters select {
  min-height: 40px;
  padding: .35rem .5rem;
  border: 1px solid var(--line);
  background: #161513;
  color: var(--ink);
}
.filters input[type="search"] { min-width: 12rem; }
.filters .checkbox { justify-content: flex-end; }
.filters .checkbox label {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .85rem;
  color: var(--ink);
  letter-spacing: 0;
  min-height: 40px;
}
.filters button[type="reset"] { min-height: 40px; padding: .3rem .8rem; font-size: .82rem; }

.row-actions { display: flex; align-items: center; gap: .5rem; }
button.bookmark {
  min-height: 40px;
  min-width: 40px;
  padding: .2rem .5rem;
  border-color: var(--line);
  box-shadow: none;
  font-size: 1.1rem;
  line-height: 1;
}
button.bookmark[aria-pressed="true"] { color: var(--gold); border-color: var(--gold); }
button.bookmark:hover { transform: none; box-shadow: none; border-color: var(--gold); }

@media (max-width: 560px) {
  .track .row-actions { grid-column: 2; justify-self: start; }
}
