/* dtm:/mine — 手書きのCSS。外部フォント・外部CDNは使わない。
   ジャンルの色(.g-xxx { --g })は build.py が末尾に足す。 */

:root {
  --limestone: #E6E9EC;   /* 背景: 石灰岩の冷たい灰 */
  --paper: #F7F8F9;       /* 紙の白 */
  --slate: #1C2430;       /* 文字 */
  --slate-2: #47515E;     /* 補助の文字 */
  --rock: #2A3340;        /* フッター: 岩のダーク */
  --rule: #C3C9D0;        /* 罫線 */
  --stone: #B4BBC3;       /* コアサンプルの岩の部分 */
  --link: #2A478F;        /* ラピス系 */
  --g: #6B7480;           /* ジャンル色の既定値 */
  --core-h: clamp(76px, 13vw, 136px);
  --sans: "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", YuGothic, Meiryo, "Noto Sans JP", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, "Liberation Mono", Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--limestone);
  color: var(--slate);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.85;
  text-align: left;
  line-break: strict;
  overflow-wrap: anywhere;
}

h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }

h1, h2, h3 { font-weight: 800; line-height: 1.3; letter-spacing: 0.01em; }
h1 { font-size: clamp(1.9rem, 5.2vw, 3rem); }
h2 { font-size: clamp(1.4rem, 3.4vw, 1.75rem); }
h3 { font-size: 1.125rem; }

a { color: var(--link); text-decoration: underline; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid var(--link); outline-offset: 3px; border-radius: 2px; }

.wrap { width: 100%; max-width: 68rem; margin: 0 auto; padding: 0 clamp(1rem, 4vw, 2.5rem); }

.skip { position: absolute; left: 1rem; top: -4rem; z-index: 10; padding: 0.5rem 0.9rem; background: var(--paper); color: var(--slate); }
.skip:focus { top: 0.5rem; }

/* ---- 試作版の帯 ---- */
.proto-bar {
  display: flex; flex-wrap: wrap; gap: 0.1rem 0.9rem;
  padding: 0.45rem clamp(1rem, 4vw, 2.5rem);
  background: var(--slate); color: var(--paper);
  font-size: 0.8125rem; line-height: 1.6;
  border-bottom: 3px solid #C98A1B;
}
.proto-bar strong { font-weight: 800; }

/* ---- ヘッダー ---- */
.site-head { background: var(--paper); border-bottom: 1px solid var(--rule); }
.head-inner { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 0.2rem 1.5rem; padding-top: 0.8rem; padding-bottom: 0.8rem; }
.logo { font-family: var(--mono); font-weight: 800; font-size: 1.25rem; letter-spacing: -0.02em; color: var(--slate); text-decoration: none; }
.logo-mark { color: var(--link); }
.nav { display: flex; flex-wrap: wrap; gap: 0.1rem 1.25rem; font-size: 0.9375rem; }
.nav a { display: inline-block; padding: 0.3rem 0; color: var(--slate); text-decoration: none; border-bottom: 2px solid transparent; }
.nav a:hover { border-bottom-color: var(--rule); }
.nav a[aria-current="page"] { border-bottom-color: var(--slate); font-weight: 700; }

/* ---- ヒーロー ---- */
.hero { padding: clamp(2.5rem, 7vw, 5.5rem) 0 clamp(2.5rem, 6vw, 4.5rem); }
.hero-logo {
  font-family: var(--mono);
  font-size: clamp(2.75rem, 14.4vw, 10rem);
  font-weight: 800; line-height: 1; letter-spacing: -0.045em;
  margin-left: -0.04em;
}
.hero-copy { margin-top: clamp(1rem, 2.4vw, 1.75rem); font-size: clamp(1.25rem, 3.4vw, 2rem); font-weight: 800; line-height: 1.4; }

.core-cap { margin-top: clamp(2.25rem, 6vw, 4rem); margin-bottom: 0.7rem; font-size: 0.875rem; color: var(--slate-2); }
.core-cap-name { margin-right: 0.9em; font-weight: 800; color: var(--slate); }

/* コアサンプル: 岩芯の円柱。縞1本 = 掲載中の1曲 */
.core-wrap { position: relative; }
.core {
  display: flex; height: var(--core-h);
  border-radius: calc(var(--core-h) * 0.2) / 50%;
  overflow: hidden;
  background: var(--stone);
}
.core-shade {
  position: absolute; top: 0; left: 0; right: 0; height: var(--core-h);
  border-radius: calc(var(--core-h) * 0.2) / 50%;
  pointer-events: none;
  background: linear-gradient(to bottom,
    rgba(255,255,255,0.42) 0%, rgba(255,255,255,0.14) 16%, rgba(255,255,255,0) 40%,
    rgba(0,0,0,0) 56%, rgba(0,0,0,0.16) 82%, rgba(0,0,0,0.34) 100%);
  box-shadow: inset 0 0 0 1px rgba(28,36,48,0.22);
}
.rock {
  flex: 1 1 0;
  background-color: var(--stone);
  background-image:
    repeating-linear-gradient(90deg, rgba(28,36,48,0.07) 0 2px, transparent 2px 9px),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.10) 0 1px, transparent 1px 23px);
}
.rw1 { flex-grow: 0.7; } .rw2 { flex-grow: 1.2; } .rw3 { flex-grow: 1.8; }
.vein {
  flex: 2 1 0; min-width: 14px;
  background-color: var(--g);
  background-image: linear-gradient(90deg, rgba(255,255,255,0.20), rgba(255,255,255,0) 35%, rgba(0,0,0,0.16));
}
.vw1 { flex-grow: 2; } .vw2 { flex-grow: 2.8; } .vw3 { flex-grow: 3.6; }
.vein:hover, .vein:focus-visible { background-image: linear-gradient(90deg, rgba(255,255,255,0.34), rgba(255,255,255,0.14)); }
.vein:focus-visible { outline: 3px solid #fff; outline-offset: -6px; box-shadow: inset 0 0 0 3px var(--slate); border-radius: 0; }

.core-hint, .readout {
  min-height: 3.4em; padding-top: 0.75rem;
  font-size: 0.9375rem; line-height: 1.7; color: var(--slate-2);
}
.readout {
  position: absolute; left: 0; right: 0; top: var(--core-h);
  background: var(--limestone); color: var(--slate);
  visibility: hidden;
}
.readout b { font-weight: 800; margin-right: 0.6em; }
.readout-genre { margin-left: 0.9em; padding-left: 0.9em; border-left: 0.3em solid var(--g); color: var(--slate-2); }
.vein:hover .readout, .vein:focus .readout { visibility: visible; }

.legend { display: flex; flex-wrap: wrap; gap: 0.2rem 1.5rem; margin-top: 0.4rem; font-size: 0.8125rem; color: var(--slate-2); }
.chip { display: inline-block; width: 0.8em; height: 0.8em; margin-right: 0.5em; background: var(--g); border-radius: 2px; vertical-align: -0.05em; }
.mineral { margin-left: 0.6em; font-size: 0.8125rem; color: var(--slate-2); }
.mineral::before { content: "("; } .mineral::after { content: ")"; }

/* 動きはここだけ: コアサンプルが左から現れる */
@media (prefers-reduced-motion: no-preference) {
  .core, .core-shade { animation: core-in 1.3s cubic-bezier(0.2, 0.7, 0.2, 1); } /* 終了後は clip-path を残さない(曲名の表示が切れるため) */
  @keyframes core-in {
    from { clip-path: inset(0 100% 0 0); }
    to { clip-path: inset(0 0 0 0); }
  }
}

/* ---- トップの各段 ---- */
.band { padding: clamp(2.5rem, 6vw, 4.5rem) 0; background: var(--paper); border-top: 1px solid var(--rule); }
.band-grid { display: grid; gap: 1.5rem; }
.band-head p { margin-top: 0.6rem; font-size: 0.9375rem; color: var(--slate-2); max-width: 22em; }
.band-body { min-width: 0; }
@media (min-width: 56rem) {
  .band-grid { grid-template-columns: 17rem minmax(0, 1fr); gap: 3rem; }
}
.band-makers { background: var(--limestone); }
.lead-sub { font-size: 1.0625rem; max-width: 38em; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.9rem 1.5rem; margin-top: 1.5rem; }

/* 曲の行: 左にジャンル色の帯 */
.rows { border-top: 1px solid var(--rule); }
.row {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.1rem 1.5rem;
  padding: 1rem 0.75rem 1rem 1.4rem;
  border-bottom: 1px solid var(--rule);
}
.row::before { content: ""; position: absolute; left: 0; top: 0.9rem; bottom: 0.9rem; width: 0.5rem; background: var(--g); }
.row:hover { background: #EEF0F3; }
.row-title { font-size: 1.25rem; }
.row-title a { color: var(--slate); text-decoration: none; }
.row-title a::after { content: ""; position: absolute; inset: 0; }
.row:hover .row-title a { text-decoration: underline; }
.row-artist { font-size: 0.9375rem; }
.row-genre, .row-tools { font-size: 0.875rem; color: var(--slate-2); }
.row-label { margin-right: 0.7em; font-size: 0.75rem; font-weight: 700; }
@media (min-width: 44rem) {
  .row { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: baseline; }
  .row-title { grid-column: 1; grid-row: 1; }
  .row-artist { grid-column: 1; grid-row: 2; }
  .row-genre { grid-column: 2; grid-row: 1; }
  .row-tools { grid-column: 2; grid-row: 2; }
}

.tag-sample {
  display: inline-block; margin-left: 0.7em; padding: 0 0.5em;
  border: 1px solid var(--slate-2); border-radius: 2px;
  font-size: 0.6875rem; font-weight: 700; line-height: 1.7; color: var(--slate-2);
  vertical-align: 0.25em; letter-spacing: 0.04em; white-space: nowrap;
}

/* 掘り当て方: 順番のある3段階 */
.steps { counter-reset: step; }
.steps li {
  counter-increment: step;
  display: grid; grid-template-columns: 3.25rem minmax(0, 1fr); column-gap: 0.75rem;
  padding: 1.25rem 0; border-top: 1px solid var(--rule);
}
.steps li:last-child { border-bottom: 1px solid var(--rule); }
.steps li::before {
  content: counter(step);
  grid-row: 1 / span 2;
  font-family: var(--mono); font-size: 2.5rem; font-weight: 800; line-height: 1; color: var(--slate);
}
.steps h3 { font-size: 1.25rem; }
.steps p { margin-top: 0.35rem; max-width: 36em; }

/* ---- ボタン ---- */
.btn {
  display: inline-block; padding: 0.75rem 1.4rem;
  background: var(--slate); color: var(--paper);
  border: 0; border-radius: 4px;
  font: inherit; font-weight: 700; line-height: 1.4; text-decoration: none; cursor: pointer;
}
a.btn:hover { background: #2F3B4D; }
.btn[disabled] { background: #C9CED4; color: #434C59; cursor: not-allowed; }
.text-link { font-size: 0.9375rem; }
.pending { display: inline-block; padding: 0 0.5em; background: #DDE1E6; border-radius: 2px; font-weight: 700; }

/* ---- 曲ページ ---- */
.song-strip { height: 0.75rem; background: var(--g); background-image: linear-gradient(to bottom, rgba(255,255,255,0.28), rgba(0,0,0,0.18)); }
.song .wrap { padding-top: clamp(1.75rem, 5vw, 3.25rem); padding-bottom: clamp(3rem, 7vw, 5rem); }
.song-genre { font-size: 0.875rem; color: var(--slate-2); }
.song-head h1 { margin-top: 0.5rem; }
.song-genre .tag-sample, .row-artist .tag-sample { vertical-align: 0.1em; }
.song-artist { margin-top: 0.4rem; font-size: 1.125rem; font-weight: 700; }

.embed { position: relative; margin-top: 1.75rem; max-width: 52rem; aspect-ratio: 16 / 9; background: var(--rock); }
.embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
/* 再生枠が読み込まれるまで(埋め込み先が遅い時)、暗い箱だけにならないよう一言出す。枠が出ると上に重なって見えなくなる */
.embed:not(.embed-note)::before {
  content: "再生枠を読み込んでいます…"; position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: #C3C9D0; font-size: 0.9375rem;
}
.embed-audio { aspect-ratio: auto; height: 166px; }
.embed-note {
  display: flex; align-items: center; justify-content: flex-start;
  padding: clamp(1.25rem, 5vw, 3rem);
  color: var(--slate);
  background-color: var(--paper);
  background-image: repeating-linear-gradient(135deg, rgba(28,36,48,0.05) 0 10px, transparent 10px 22px);
  border: 1px solid var(--rule); border-left: 0.5rem solid var(--g);
}
.embed-note p { max-width: 30em; font-size: 0.9375rem; }
.embed-note strong { font-size: 1.125rem; font-weight: 800; }

.song-grid { display: grid; gap: 2rem; margin-top: 2.25rem; max-width: 52rem; }
@media (min-width: 48rem) { .song-grid { grid-template-columns: minmax(0, 1fr) 16rem; gap: 3rem; } }
.song-intro h2 { margin-bottom: 0.75rem; }
.song-intro p + p { margin-top: 1em; }
.song-intro p { max-width: 40em; }
.song-facts { font-size: 0.9375rem; }
.song-facts dl { border-top: 3px solid var(--g); }
.song-facts dt { margin-top: 0.9rem; font-size: 0.8125rem; font-weight: 800; color: var(--slate-2); }
.song-facts dd { padding-bottom: 0.9rem; border-bottom: 1px solid var(--rule); }
.song-takedown { margin-top: 2.5rem; font-size: 0.9375rem; }
.pager { display: grid; gap: 0.75rem; margin: 2rem 0 1.5rem; max-width: 52rem; }
@media (min-width: 40rem) { .pager { grid-template-columns: 1fr 1fr; } }
.pager-link { display: block; padding: 0.8rem 1rem; background: var(--paper); border: 1px solid var(--rule); color: var(--slate); font-weight: 700; text-decoration: none; }
.pager-link:hover { border-color: var(--slate); }
.pager-link span { display: block; font-size: 0.75rem; font-weight: 400; color: var(--slate-2); }

/* ---- 文章のページ ---- */
.doc { padding: clamp(2rem, 6vw, 4rem) 0 clamp(3rem, 7vw, 5rem); }
.doc-body { max-width: 40em; }
.doc h1 { margin-bottom: 1.25rem; }
.doc h2 { margin-top: 2.75rem; margin-bottom: 0.75rem; padding-top: 1.25rem; border-top: 1px solid var(--rule); }
.doc h3 { margin-top: 1.75rem; margin-bottom: 0.4rem; }
.doc p + p, .doc ul + p, .doc ol + p, .doc p + ul, .doc p + ol, .doc dl + p { margin-top: 1em; }
.doc .lead { font-size: 1.125rem; font-weight: 700; line-height: 1.75; }
.doc ul.list, .doc ol.list { padding-left: 1.4em; }
.doc ul.list { list-style: disc; }
.doc ol.list { list-style: decimal; }
.doc .list li + li { margin-top: 0.4em; }
.doc .updated { margin-top: 3rem; font-size: 0.875rem; color: var(--slate-2); }

.notice {
  margin-bottom: 1.75rem; padding: 0.9rem 1.1rem;
  background: var(--paper); border: 1px solid var(--rule); border-left: 0.5rem solid #C98A1B;
  font-size: 0.9375rem;
}
.notice strong { font-weight: 800; }

.facts { margin-top: 1rem; border-top: 1px solid var(--rule); }
.facts > div { display: grid; gap: 0.1rem 1.5rem; padding: 0.8rem 0; border-bottom: 1px solid var(--rule); }
.facts dt { font-weight: 800; }
.facts .opt { margin-left: 0.6em; font-size: 0.75rem; font-weight: 400; color: var(--slate-2); }
@media (min-width: 40rem) { .facts > div { grid-template-columns: 13rem minmax(0, 1fr); } }

.minerals { margin-top: 1rem; border-top: 1px solid var(--rule); }
.minerals li { position: relative; padding: 0.6rem 0 0.6rem 1.4rem; border-bottom: 1px solid var(--rule); }
.minerals li::before { content: ""; position: absolute; left: 0; top: 0.6rem; bottom: 0.6rem; width: 0.5rem; background: var(--g); }

/* ---- フッター ---- */
.site-foot { background: var(--rock); color: #E6E9EC; padding: clamp(2rem, 5vw, 3.25rem) 0; font-size: 0.9375rem; }
.foot-inner { display: grid; gap: 1.5rem; }
@media (min-width: 48rem) { .foot-inner { grid-template-columns: 17rem minmax(0, 1fr); column-gap: 3rem; } .foot-op { grid-column: 2; } }
.foot-logo { font-family: var(--mono); font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; }
.site-foot .logo-mark { color: #9DB4EC; }
.foot-copy { margin-top: 0.3rem; color: #C3C9D0; }
.foot-links { display: grid; gap: 0.3rem 2rem; }
@media (min-width: 30rem) { .foot-links { grid-template-columns: 1fr 1fr; } }
.site-foot a { color: #E6E9EC; }
.site-foot :focus-visible { outline-color: #fff; }
.foot-op { color: #C3C9D0; font-size: 0.875rem; }

/* ---- ジャンルの色(build.py の GENRES から生成) ---- */
.g-ruby { --g: #B3263E; }
.g-amber { --g: #C98A1B; }
.g-lapis { --g: #2F4F9E; }
.g-malachite { --g: #1F8A5F; }
.g-amethyst { --g: #7A4FA0; }
.g-turquoise { --g: #14A3A8; }
