/* MUSIC BLOG — ショートと同じ世界観
   色は Theta（theta-rig.js）の 4 色：墨 ink / 金 gold / 淡い面 echo / 紙 paper
   形は「太い筆の線」と「大きな点」だけ（派生/_common/kandinsky.py の図の文法）。細い飾り線は使わない
   点＝一打（壁＝ぶつかる出来事）、線＝続く音（選択＝その先へ続く道）、淡い大きな字＝背景の図案 */

:root {
  --paper: #f3f2f2;
  --ink: #201f1d;
  --ink-2: #57534d;
  --gold: #8a6122;
  --echo: #e7d3b0;
  --wash: #ebe6dd;
  --line: rgba(32, 31, 29, 0.12);

  --f-display: "Jost", "Futura", "Avenir Next", system-ui, sans-serif;
  --f-en: "Source Serif 4", "Iowan Old Style", Georgia, serif;
  --f-ja: "Shippori Mincho B1", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --f-hand: "Klee One", "YuKyokasho", "Hiragino Mincho ProN", serif;
  --f-ui: "Helvetica Neue", "Hiragino Sans", Arial, sans-serif;

  --measure: 38rem;
  --gutter: clamp(16px, 5vw, 56px);
  color-scheme: light;
}

/* 暗い画面用の配色は作らない：Theta とショートの配色（紙と墨）をどこでも同じにする */

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-en);
  font-size: 1.125rem;
  line-height: 1.72;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
html[lang="ja"] body { font-family: var(--f-ja); font-size: 1.0625rem; line-height: 2; letter-spacing: 0.02em; font-weight: 500; }

a { color: inherit; text-decoration-color: var(--gold); text-decoration-thickness: 2px; text-underline-offset: 0.2em; }
a:hover { color: var(--gold); }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 4px; }

.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--paper); padding: 0.5rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; }

.kicker {
  font-family: var(--f-display);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin: 0;
}
html[lang="ja"] .kicker { letter-spacing: 0.1em; }
.status {
  display: inline-block; font-family: var(--f-ui); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--paper); background: var(--ink); padding: 0.1em 0.6em; border-radius: 999px; vertical-align: 0.1em;
}

/* ---------- 筆の線と点（マスクで形を切り、色はページ側で塗る） ---------- */
.under, .rule, .dot, .stroke, .brand-mark {
  display: block;
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-position: left center; mask-position: left center;
  -webkit-mask-size: 100% 100%; mask-size: 100% 100%;
}
.under { width: min(26rem, 70%); height: auto; aspect-ratio: 800 / 68; background: var(--gold); -webkit-mask-image: var(--brush-under); mask-image: var(--brush-under); margin: 0.6rem 0 1.4rem; }
.rule { width: min(100%, 30rem); height: auto; aspect-ratio: 600 / 44; background: var(--ink); opacity: 0.9; margin-bottom: 1.2rem; }
.rule.r1 { -webkit-mask-image: var(--brush-rule-1); mask-image: var(--brush-rule-1); }
.rule.r2 { -webkit-mask-image: var(--brush-rule-2); mask-image: var(--brush-rule-2); }
.rule.r3 { -webkit-mask-image: var(--brush-rule-3); mask-image: var(--brush-rule-3); }

/* ---------- 上下 ---------- */
.top {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding: 1.1rem var(--gutter);
  font-family: var(--f-display);
  position: relative; z-index: 2;
}
.brand { display: inline-flex; align-items: center; gap: 0.65rem; text-decoration: none; font-weight: 600; letter-spacing: 0.16em; font-size: 0.95rem; }
.brand:hover { color: inherit; }
.brand-mark {
  width: 2.1rem; height: 2.1rem; display: inline-grid; place-items: center;
  background: var(--ink); color: var(--paper);
  -webkit-mask-image: var(--ink-point-1); mask-image: var(--ink-point-1);
  font-family: var(--f-ja); font-weight: 800; font-size: 1.05rem; letter-spacing: 0; line-height: 1;
}
.brand-mark.small { width: 1.6rem; height: 1.6rem; font-size: 0.8rem; }
.brand-ja { font-family: var(--f-ja); font-weight: 700; letter-spacing: 0.12em; font-size: 0.85rem; color: var(--gold); }
.hero-ja { display: block; font-family: var(--f-ja); font-weight: 800; font-size: clamp(1.3rem, 3vw, 2.1rem); letter-spacing: 0.35em; color: var(--gold); margin-top: 0.9rem; line-height: 1; }
.provisional { font-weight: 400; letter-spacing: 0.02em; color: var(--ink-2); font-size: 0.8rem; }
.top-nav { display: flex; align-items: center; gap: 1.3rem; font-size: 0.92rem; flex-wrap: wrap; }
.top-nav a { text-decoration: none; }
.top-nav a:hover { text-decoration: underline; }
.lang-switch { border: 2px solid var(--ink); border-radius: 999px; padding: 0.15rem 0.8rem; }
.lang-switch:hover { border-color: var(--gold); text-decoration: none !important; }
.draft-flag { font-family: var(--f-ui); font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; background: var(--echo); color: var(--ink); padding: 0.2rem 0.7rem; border-radius: 999px; }

.bottom {
  display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap;
  padding: 3rem var(--gutter) 3.5rem; font-family: var(--f-display); font-size: 0.85rem; color: var(--ink-2);
}
.bottom .sep { opacity: 0.5; }

/* ---------- トップページ ---------- */
.hero {
  position: relative; min-height: min(78vh, 46rem);
  padding: clamp(3rem, 10vh, 7rem) var(--gutter) 4rem;
  display: grid; align-items: end;
}
.hero-kanji {
  position: absolute; right: -0.06em; top: 50%; transform: translateY(-50%);
  font-family: var(--f-ja); font-weight: 800; color: var(--echo);
  font-size: clamp(16rem, 52vw, 44rem); line-height: 0.85; user-select: none; z-index: 0;
}
.hero-text { position: relative; z-index: 1; max-width: 40rem; }
.hero-title {
  font-family: var(--f-display); font-weight: 600; letter-spacing: 0.04em;
  font-size: clamp(3rem, 10vw, 7rem); line-height: 0.95; margin: 0.8rem 0 0;
}
.lede { font-size: clamp(1.15rem, 2.2vw, 1.45rem); max-width: 32rem; margin: 0; }
.hero-theta { position: absolute; z-index: 1; right: clamp(1rem, 12vw, 14rem); bottom: 2.5rem; width: clamp(110px, 16vw, 190px); }

.articles, .about { padding: 2rem var(--gutter) 3rem; max-width: 64rem; margin: 0 auto; }
.articles .sec, .about .sec { margin-top: 1rem; }
.about .prose { margin: 0; padding: 0; max-width: var(--measure); }

.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.5rem; }
.card a {
  display: grid; grid-template-columns: auto 1fr; gap: clamp(1rem, 4vw, 2.5rem); align-items: center;
  text-decoration: none; background: var(--wash); border-radius: 22px; padding: clamp(1.2rem, 3vw, 2rem) clamp(1.2rem, 4vw, 2.5rem);
  transition: transform 0.25s ease;
}
.card a:hover { color: inherit; transform: translateY(-2px); }
.card a:hover .card-title { text-decoration: underline; text-decoration-color: var(--gold); }
.card-motif {
  writing-mode: vertical-rl; font-family: var(--f-ja); font-weight: 800; color: var(--gold);
  font-size: clamp(2.6rem, 7vw, 4.2rem); line-height: 1; letter-spacing: 0.05em;
}
.card-body { display: grid; gap: 0.45rem; }
.card-title { font-family: var(--f-display); font-weight: 600; font-size: clamp(1.35rem, 3vw, 1.9rem); line-height: 1.2; }
html[lang="ja"] .card-title { font-family: var(--f-ja); font-weight: 800; line-height: 1.45; }
.card-q { color: var(--ink-2); }

/* ---------- 記事 ---------- */
.post-hero {
  position: relative; padding: clamp(2.5rem, 8vh, 5.5rem) var(--gutter) 2.5rem;
  max-width: 64rem; margin: 0 auto; min-height: 28rem;
}
.motif {
  position: absolute; top: 0.5rem; right: calc(var(--gutter) - 0.1em);
  writing-mode: vertical-rl; font-family: var(--f-ja); font-weight: 800; color: var(--echo);
  font-size: clamp(7rem, 20vw, 17rem); line-height: 1; z-index: 0; user-select: none;
}
.post-hero > *:not(.motif) { position: relative; z-index: 1; }
.post-hero h1 {
  font-family: var(--f-display); font-weight: 600; letter-spacing: -0.005em;
  font-size: clamp(2.3rem, 6vw, 4.4rem); line-height: 1.06; margin: 0.9rem 0 0; max-width: min(12em, 100%);
}
html[lang="ja"] .post-hero h1 { font-family: var(--f-ja); font-weight: 800; line-height: 1.35; letter-spacing: 0.02em; max-width: 13em; font-size: clamp(2rem, 5vw, 3.6rem); }
.question { display: grid; gap: 0.35rem; margin: 0 0 1.3rem; max-width: 34rem; }
.q-label { font-family: var(--f-hand); color: var(--gold); font-size: 1rem; }
html[lang="en"] .q-label { font-family: var(--f-display); font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase; }
.q-text { font-family: var(--f-display); font-weight: 500; font-size: clamp(1.3rem, 2.8vw, 1.75rem); line-height: 1.3; }
html[lang="ja"] .q-text { font-family: var(--f-ja); font-weight: 700; line-height: 1.6; }
.buffer { color: var(--ink-2); font-size: 0.95rem; max-width: 34rem; margin: 0; }
.draft-note { display: inline-block; margin: 1.2rem 0 0; background: var(--echo); padding: 0.35rem 0.9rem; border-radius: 10px; font-family: var(--f-ui); font-size: 0.85rem; }

.toc { max-width: 64rem; margin: 0 auto; padding: 0 var(--gutter) 1rem; }
.toc ol { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1.6rem; font-family: var(--f-display); font-size: 0.95rem; }
html[lang="ja"] .toc ol { font-family: var(--f-ja); }
.toc a { text-decoration: none; display: inline-flex; gap: 0.45rem; align-items: baseline; }
.toc a:hover { text-decoration: underline; }
.toc-no { color: var(--gold); font-family: var(--f-display); font-weight: 600; }

.prose { max-width: var(--measure); margin: 0 auto; padding: 0 var(--gutter); }
.post .prose { max-width: 64rem; }
.post .prose > * { max-width: var(--measure); }
.post .prose > .short, .post .prose > .track { max-width: 46rem; }
html[lang="ja"] :is(.post-hero h1, .q-text, .wall .h-text, .choice .h-text, .card-title, .sec-title) { word-break: auto-phrase; }
.prose p { margin: 0 0 1.25em; hyphens: auto; }
html[lang="ja"] .prose p { hyphens: none; line-break: strict; }
.prose ul { padding-left: 1.2em; margin: 0 0 1.4em; }
.prose li { margin-bottom: 0.6em; }
.prose li::marker { color: var(--gold); }
.prose strong { font-weight: 600; }
html[lang="ja"] .prose strong { font-weight: 800; }
.cite { font-size: 0.85em; color: var(--ink-2); }

/* 節：上に長い筆の線、番号は金 */
.sec { margin: 5rem 0 1.8rem; font-family: var(--f-display); font-weight: 600; font-size: clamp(1.6rem, 3.4vw, 2.2rem); line-height: 1.2; }
html[lang="ja"] .sec { font-family: var(--f-ja); font-weight: 800; }
.sec-no { color: var(--gold); margin-right: 0.7rem; font-family: var(--f-display); }

/* 壁：大きな点（ぶつかる一打）。反論は淡い点 */
.wall, .choice { display: grid; grid-template-columns: auto 1fr; gap: 1rem; align-items: start; margin: 3.2rem 0 1.2rem; }
.dot { width: 2.6rem; height: 2.6rem; background: var(--ink); margin-top: 0.2rem; }
.dot.d1 { -webkit-mask-image: var(--ink-point-1); mask-image: var(--ink-point-1); }
.dot.d2 { -webkit-mask-image: var(--ink-point-2); mask-image: var(--ink-point-2); }
.dot.d3 { -webkit-mask-image: var(--ink-point-3); mask-image: var(--ink-point-3); }
.dot.hollow { background: var(--echo); -webkit-mask-image: var(--ink-point-2); mask-image: var(--ink-point-2); }
.h-body { display: grid; gap: 0.25rem; }
.h-no { font-family: var(--f-display); font-weight: 500; font-size: 0.78rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold); }
html[lang="ja"] .h-no { font-family: var(--f-hand); font-size: 0.95rem; letter-spacing: 0.06em; text-transform: none; }
.wall .h-text { font-family: var(--f-display); font-weight: 500; font-size: clamp(1.3rem, 2.6vw, 1.6rem); line-height: 1.3; }
html[lang="ja"] .wall .h-text { font-family: var(--f-ja); font-weight: 700; line-height: 1.6; }

/* 選択：短い筆の線（その先へ続く） */
.choice { margin-top: 1.8rem; }
.stroke { width: 2.6rem; height: auto; aspect-ratio: 120 / 32; background: var(--gold); margin-top: 0.75rem; -webkit-mask-image: var(--brush-choice); mask-image: var(--brush-choice); }
.choice .h-text { font-family: var(--f-display); font-weight: 500; font-size: 1.2rem; line-height: 1.35; }
html[lang="ja"] .choice .h-text { font-family: var(--f-ja); font-weight: 700; font-size: 1.1rem; line-height: 1.7; }
.tags { display: flex; gap: 0.35rem; margin-top: 0.3rem; }
.tag { font-family: var(--f-ui); font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; padding: 0.18em 0.7em; border-radius: 999px; line-height: 1.5; }
html[lang="en"] .tag { text-transform: uppercase; }
.tag-fact { box-shadow: inset 0 0 0 2px var(--ink); }
.tag-interp { background: var(--echo); }
h3.plain { font-family: var(--f-display); font-weight: 600; font-size: 1.3rem; margin: 3rem 0 1rem; }
html[lang="ja"] h3.plain { font-family: var(--f-ja); font-weight: 800; }

/* 引用：左に金の縦の筆 */
.quote { position: relative; margin: 2.2rem 0; padding: 0.2rem 0 0.2rem 2.2rem; }
.quote::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 0.9rem; background: var(--gold);
  -webkit-mask: var(--brush-vbar) center / 100% 100% no-repeat; mask: var(--brush-vbar) center / 100% 100% no-repeat;
}
.quote p { font-size: clamp(1.3rem, 2.6vw, 1.6rem); line-height: 1.45; margin: 0 0 0.6rem; font-style: italic; }
html[lang="ja"] .quote p { font-style: normal; font-weight: 700; line-height: 1.8; }
.quote footer { font-size: 0.85rem; color: var(--ink-2); }

.listen { background: var(--wash); border-radius: 16px; padding: 1.1rem 1.4rem; margin: 2rem 0; }
.listen p { margin: 0; }
.listen .listen-label { font-family: var(--f-hand); color: var(--gold); margin-bottom: 0.3rem; }
html[lang="en"] .listen .listen-label { font-family: var(--f-display); font-size: 0.8rem; letter-spacing: 0.14em; text-transform: uppercase; }
.note { color: var(--ink-2); font-size: 0.9rem; }

/* ショート：縦長の画面 */
.short {
  display: grid; grid-template-columns: minmax(140px, 200px) 1fr; gap: 1.5rem; align-items: center;
  margin: 3rem 0; padding: 1.2rem; background: var(--wash); border-radius: 22px;
}
.short-frame { aspect-ratio: 9 / 16; border-radius: 14px; overflow: hidden; background: #201f1d; }
.short-frame video, .short-frame iframe { width: 100%; height: 100%; display: block; border: 0; object-fit: cover; }
.short figcaption { display: grid; gap: 0.35rem; }
.short-title { font-family: var(--f-display); font-weight: 600; font-size: 1.3rem; line-height: 1.25; }
.short-sub { color: var(--ink-2); font-family: var(--f-display); }
.short-lang { font-family: var(--f-ui); font-size: 0.75rem; color: var(--ink-2); }
.short-link { font-family: var(--f-display); font-weight: 500; margin-top: 0.4rem; }

/* 曲：線の太さ＝音量、沈黙は余白 */
.track { margin: 3rem 0; padding: 1.3rem 1.4rem 1.5rem; background: var(--wash); border-radius: 22px; }
.track-head { display: grid; grid-template-columns: auto 1fr auto; gap: 1rem; align-items: center; margin-bottom: 1rem; }
.track-play {
  width: 3.4rem; height: 3.4rem; border: 0; padding: 0; cursor: pointer; background: var(--ink);
  -webkit-mask: var(--ink-point-3) center / 100% 100% no-repeat; mask: var(--ink-point-3) center / 100% 100% no-repeat;
  display: grid; place-items: center;
}
.track-play:hover { background: var(--gold); }
.track-play .ico { width: 0; height: 0; border-style: solid; border-width: 0.6rem 0 0.6rem 1rem; border-color: transparent transparent transparent var(--paper); margin-left: 0.25rem; }
.track-play.is-playing .ico { width: 0.9rem; height: 1.1rem; border: 0; margin: 0; background: linear-gradient(90deg, var(--paper) 0 35%, transparent 35% 65%, var(--paper) 65%); }
.track-title { display: grid; gap: 0.1rem; }
.track-title strong { font-family: var(--f-display); font-weight: 600; font-size: 1.2rem; letter-spacing: 0.04em; }
.track-time { font-family: var(--f-ui); font-size: 0.85rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.track-wave { position: relative; height: clamp(56px, 9vw, 96px); cursor: pointer; --p: 0%; }
.wave { position: absolute; inset: 0; -webkit-mask: var(--wave) center / 100% 100% no-repeat; mask: var(--wave) center / 100% 100% no-repeat; }
.wave.base { background: var(--ink); opacity: 0.85; }
.wave.done { background: var(--gold); clip-path: inset(0 calc(100% - var(--p)) 0 0); }

/* 用語 */
.glossary { margin: 1.5rem 0 2rem; display: grid; gap: 1.1rem; }
.gl-row { display: grid; grid-template-columns: minmax(8rem, 12rem) 1fr; gap: 0.3rem 1.4rem; }
.glossary dt { display: grid; align-content: start; }
.glossary .term { font-family: var(--f-display); font-weight: 600; }
html[lang="ja"] .glossary .term { font-family: var(--f-ja); font-weight: 800; }
.glossary .reading { font-family: var(--f-hand); color: var(--gold); font-size: 0.9rem; }
.glossary dd { margin: 0; }

.post-end { max-width: 64rem; margin: 5rem auto 0; padding: 0 var(--gutter); display: grid; justify-items: start; gap: 0.2rem; font-family: var(--f-display); }
html[lang="ja"] .post-end { font-family: var(--f-ja); }
.post-end .theta { width: 120px; margin-bottom: 0.5rem; }
.post-end p { margin: 0.2rem 0; }

.nf { padding: 4rem var(--gutter); max-width: 36rem; margin: 0 auto; text-align: center; font-family: var(--f-display); }
.nf .theta { width: 150px; margin: 0 auto 1rem; }

/* ---------- 狭い画面 ---------- */
@media (max-width: 640px) {
  body { font-size: 1.0625rem; }
  .hero { min-height: 36rem; align-items: start; padding-top: 3rem; }
  .hero-kanji { top: auto; bottom: -0.1em; transform: none; font-size: 22rem; }
  .hero-theta { right: 1.2rem; bottom: 1.5rem; width: 100px; }
  .motif { font-size: 7.5rem; right: 0.2rem; opacity: 0.9; }
  .post-hero { min-height: 0; }
  .card a { grid-template-columns: 1fr; }
  .card-motif { writing-mode: horizontal-tb; font-size: 2.2rem; }
  .short { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .short-frame { width: min(240px, 70vw); }
  .short figcaption { justify-items: center; }
  .gl-row { grid-template-columns: 1fr; }
  .track-head { grid-template-columns: auto 1fr; }
  .track-time { grid-column: 2; }
  .wall, .choice { gap: 0.75rem; }
  .dot { width: 2.1rem; height: 2.1rem; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
