/* TSUMUGI 紬 — 工芸アトリエ(架空)
   暗い蔵×行灯の金。背景のギャラリー空間は #bg の WebGL が全て描く。
   作品画像はコード生成プレースホルダ(assets/img/cut1〜4.jpg で差し替え可能)。 */

:root {
  --bg: #0d0c0a;
  --bg-2: #16130e;
  --ink: #f0eae0;
  --ink-dim: #b9ae9d;
  /* AA 確保: 対 --bg で約 6.2:1（旧 #7c7364 は 4.2:1 で未達だった） */
  --ink-faint: #9a917f;
  --gold: #c8a45c;
  --gold-bright: #e2c184;
  --indigo: #8095c0;
  --line: rgba(240, 234, 224, .13);
  --line-strong: rgba(240, 234, 224, .27);
  --glass: rgba(20, 17, 12, .58);
  --radius: 14px;
  --surface: rgba(14, 12, 9, .96);
  --serif-en: "Cormorant Garamond", "Times New Roman", serif;
  --serif: "BIZ UDPMincho", "Hiragino Mincho ProN", "Yu Mincho", serif;
  --display: "Cormorant Garamond", "Zen Antique", serif;
  --sans: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", sans-serif;
  --fs-body: clamp(14.5px, 1.05vw, 17px);
  --fs-note: clamp(12px, .85vw, 13.5px);
  --fs-label: clamp(11.5px, .8vw, 13px);
  --ease: cubic-bezier(.16, 1, .3, 1);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  background:
    radial-gradient(1000px 700px at 82% -10%, rgba(200, 164, 92, .09), transparent 58%),
    radial-gradient(900px 620px at 6% 110%, rgba(128, 149, 192, .06), transparent 55%),
    var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  line-height: 1.95;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* WebGL キャンバス。常に最背面に固定 */
#bg {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: 0; display: block;
}
.no-webgl #bg { display: none; }

/* 周辺減光 */
body::after {
  content: ""; position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background: radial-gradient(ellipse at 50% 44%, transparent 48%, rgba(4, 3, 2, .6));
}

.content, .foot { position: relative; z-index: 1; }

::selection { background: rgba(200, 164, 92, .35); }

/* ── ガラスパネル共通 ─────────────────────── */
.glass {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(15px) saturate(1.1);
  -webkit-backdrop-filter: blur(15px) saturate(1.1);
  box-shadow: 0 18px 50px rgba(3, 2, 1, .5);
}

.eyebrow {
  font-family: var(--sans);
  font-size: var(--fs-label); letter-spacing: .28em; text-transform: uppercase;
  color: var(--gold);
}

/* ── ナビ ─────────────────────────────────── */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px clamp(18px, 4vw, 44px);
  transition: background .35s ease, backdrop-filter .35s ease;
}
.nav.scrolled {
  background: rgba(13, 12, 10, .62);
  backdrop-filter: blur(14px) saturate(1.1);
  -webkit-backdrop-filter: blur(14px) saturate(1.1);
}
.brand {
  display: flex; align-items: center; gap: 11px;
  color: var(--ink); text-decoration: none;
}
.brand-mark {
  width: 30px; height: 30px; display: grid; place-items: center;
  border: 1px solid var(--gold); border-radius: 50%;
  color: var(--gold); font-size: 16px; line-height: 1;
}
.brand span:not(.brand-mark) {
  font-family: var(--serif-en); font-size: 20px; font-weight: 500;
  letter-spacing: .14em;
}
.brand em { font-style: normal; font-size: 12px; color: var(--ink-dim); margin-left: 4px; }
.links { display: flex; align-items: center; gap: 4px; }
.links a {
  font-family: var(--sans); font-size: 13.5px; letter-spacing: .12em;
  color: var(--ink-dim); text-decoration: none;
  padding: 8px 13px; border-radius: 999px;
  transition: color .3s var(--ease), background .3s var(--ease);
}
.links a:hover { color: var(--ink); background: rgba(240, 234, 224, .07); }
.links .pill-btn {
  color: #171204; background: var(--gold); font-weight: 600;
  margin-left: 6px;
}
.links .pill-btn:hover { color: #171204; background: var(--gold-bright); }

/* ── モバイルドロワー ──────────────────────
   このサイトのナビは「藍・陶・金継・織」＝作品目次そのもの。
   旧実装ではスマホでこれが丸ごと消えていた。 */
.menu-toggle {
  display: none; flex-direction: column; justify-content: center; align-items: center;
  gap: 6px; width: 44px; height: 44px;
  background: none; border: 0; cursor: pointer; padding: 0;
}
.menu-toggle span {
  display: block; width: 22px; height: 2px; background: var(--ink);
  transition: transform .3s var(--ease), opacity .3s var(--ease);
}
@media (max-width: 700px) {
  .menu-toggle { display: flex; }
  .links {
    position: fixed; inset: 0; z-index: -1;
    flex-direction: column; justify-content: center; gap: 6px;
    background: rgba(13, 12, 10, .95);
    -webkit-backdrop-filter: blur(18px); backdrop-filter: blur(18px);
    opacity: 0; visibility: hidden;
    transition: opacity .4s var(--ease), visibility 0s .4s;
  }
  .links.is-open { z-index: 9; opacity: 1; visibility: visible; transition: opacity .4s var(--ease); }
  .links a { font-size: 19px; padding: 14px 26px; letter-spacing: .16em; }
  .links .pill-btn { margin: 22px 0 0; }
  .menu-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  .menu-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
  .menu-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
  .menu-open, .menu-open body { overflow: hidden; }
}

/* ── ヒーロー ─────────────────────────────── */
.hero {
  min-height: 100svh;
  display: flex; align-items: center;
  padding: 0 clamp(20px, 5vw, 64px);
  position: relative;
}
/* スクリム: 額装作品が見出しの右半分に重なるため、蔵の闇を左側に戻して分離する */
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: 1; pointer-events: none;
  background: linear-gradient(98deg,
    rgba(13, 12, 10, 1) 0%, rgba(13, 12, 10, .86) 36%, rgba(13, 12, 10, .42) 54%, rgba(13, 12, 10, 0) 70%);
  background: linear-gradient(98deg,
    var(--bg) 0%,
    color-mix(in srgb, var(--bg) 86%, transparent) 36%,
    color-mix(in srgb, var(--bg) 42%, transparent) 54%,
    transparent 70%);
}
.hero > * { position: relative; z-index: 2; }
.hero-inner { max-width: 820px; }
/* 68px の和文見出しに行送り 1.5 は 2 行が分離して読めなくなる。
   ディスプレイ級の和文は 1.2〜1.3、トラッキングは負に振るのが定石。 */
.hero h1 {
  font-size: clamp(40px, 6.4vw, 78px);
  line-height: 1.24; font-weight: 500; letter-spacing: -.015em;
  margin: 18px 0 24px;
  text-shadow: 0 4px 40px rgba(4, 3, 2, .9);
}
.hero h1 em { font-style: normal; color: var(--gold); }
.hero .lead {
  font-size: clamp(14.5px, 1.5vw, 17px); color: var(--ink-dim);
  text-shadow: 0 2px 18px rgba(4, 3, 2, .9);
  max-width: 31em;
}
/* 蔵の実務情報。工芸アトリエは「いつ・どこで見られるか」が第一画面の情報 */
.hero-note {
  margin-top: clamp(26px, 3.4vw, 40px); padding-top: clamp(18px, 2.4vw, 26px);
  border-top: 1px solid var(--line-strong);
  display: flex; flex-wrap: wrap; gap: 10px 26px;
  font-family: var(--sans); font-size: var(--fs-note);
  letter-spacing: .12em; color: var(--ink-faint);
}
.hero-note b { font-weight: 500; color: var(--gold); }
.scroll-cue {
  position: absolute; left: 50%; bottom: 30px; transform: translateX(-50%);
  font-family: var(--sans); font-size: 12px; letter-spacing: .34em; color: var(--ink-faint);
  animation: cueFloat 2.6s var(--ease) infinite;
  white-space: nowrap; z-index: 2;
}
@keyframes cueFloat {
  0%, 100% { transform: translate(-50%, 0); opacity: .85; }
  50% { transform: translate(-50%, 7px); opacity: .45; }
}

/* ── 作品セクション ─────────────────────────
   165svh × 4 は 9 画面弱の空白区間を生んでいたので 115svh へ圧縮。
   main.js の timeline は 0-1 正規化なので追従する。 */
.work {
  min-height: 115svh;
  display: flex; align-items: center;
  padding: clamp(72px, 13vh, 160px) clamp(20px, 5vw, 64px);
}
.work.w-right { justify-content: flex-end; }
.work.w-left { justify-content: flex-start; }
.w-panel {
  max-width: 460px;
  padding: clamp(28px, 4vw, 42px) clamp(24px, 4vw, 42px);
  background: var(--surface);
  border-color: var(--line-strong);
}
.w-panel .num {
  font-family: var(--sans); font-size: var(--fs-label); letter-spacing: .3em;
  color: var(--indigo); text-transform: uppercase;
}
.w-panel h3 {
  font-size: clamp(24px, 3vw, 34px); font-weight: 500;
  line-height: 1.35; letter-spacing: -.01em; margin: 12px 0 12px;
}
.w-panel h3 small {
  display: block; font-family: var(--serif-en); font-weight: 400;
  font-size: var(--fs-note); color: var(--ink-faint); letter-spacing: .26em; margin-top: 8px;
}
.w-panel p { font-size: var(--fs-body); color: var(--ink-dim); }
.w-panel .chips { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 7px; }
.w-panel .chips i {
  font-style: normal; font-family: var(--sans); font-size: var(--fs-note); letter-spacing: .08em;
  border: 1px solid var(--line-strong); border-radius: 999px; padding: 4px 12px;
  color: var(--gold);
}
/* 職人の署名行。作品ごとの担当と所要を出すと工房として実在感が出る */
.w-meta {
  margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px 18px;
}
.w-meta div { display: grid; gap: 2px; }
.w-meta dt { font-family: var(--sans); font-size: var(--fs-note); letter-spacing: .14em; color: var(--ink-faint); }
.w-meta dd { font-size: var(--fs-note); color: var(--ink); }

/* ── 図録（作品一覧グリッド） ──────────────
   WebGL が落ちても作品が 1 点も見えない状態を避けるため、
   実画像を DOM に置く。同時に、他 3 サイトには無い
   「一覧で俯瞰する」区画をこのサイトの骨格として与える。 */
.catalog {
  min-height: 104svh;
  display: flex; flex-direction: column; justify-content: center;
  padding: clamp(76px, 12vh, 160px) clamp(20px, 4vw, 52px);
  max-width: 1240px; margin: 0 auto; width: 100%;
}
.sec-head { text-align: center; }
/* 3D の明部に載る小さな文字は面が無いので影で守る */
.sec-head .eyebrow { text-shadow: 0 2px 16px rgba(4, 3, 2, .95), 0 0 30px rgba(4, 3, 2, .95); }
.sec-head h2 {
  font-size: clamp(28px, 3.8vw, 44px); font-weight: 500;
  line-height: 1.3; letter-spacing: -.01em;
  margin-top: 14px; text-shadow: 0 2px 26px rgba(4, 3, 2, .9);
}
.sec-head .sec-lead {
  max-width: 38em; margin: 18px auto 0;
  font-size: var(--fs-body); color: var(--ink-dim);
  text-shadow: 0 2px 20px rgba(4, 3, 2, .9);
}
.cat-grid {
  margin-top: clamp(34px, 4.4vw, 56px);
  display: grid; gap: clamp(16px, 2vw, 26px);
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}
.cat-item {
  background: var(--surface);
  border: 1px solid var(--line);
  transition: border-color .4s var(--ease), transform .4s var(--ease);
}
.cat-item:hover { border-color: var(--gold); transform: translateY(-4px); }
.cat-item img {
  display: block; width: 100%; aspect-ratio: 16 / 9;
  object-fit: cover; border-bottom: 1px solid var(--line);
}
.cat-item .body { padding: clamp(16px, 1.8vw, 22px) clamp(16px, 1.8vw, 22px) clamp(18px, 2vw, 24px); }
.cat-item h3 {
  font-family: var(--display); font-size: clamp(17px, 1.6vw, 21px);
  font-weight: 500; line-height: 1.4; letter-spacing: .02em; margin-bottom: 8px;
}
.cat-item p { font-size: var(--fs-note); color: var(--ink-dim); line-height: 1.9; }
.cat-item .price {
  display: block; margin-top: 12px; font-family: var(--serif-en);
  font-size: clamp(15px, 1.4vw, 18px); color: var(--gold); letter-spacing: .04em;
}
.cat-note {
  margin: 24px auto 0; text-align: center; font-family: var(--sans);
  font-size: var(--fs-note); color: var(--ink-faint);
  background: var(--surface); border: 1px solid var(--line);
  padding: 10px 18px; max-width: max-content;
}

/* ── CTA ──────────────────────────────────── */
.cta {
  min-height: 100svh;
  display: grid; place-items: center;
  padding: clamp(76px, 12vh, 150px) clamp(20px, 4vw, 52px);
}
.cta-panel {
  max-width: 560px; width: 100%; text-align: center;
  padding: clamp(34px, 5vw, 56px) clamp(26px, 5vw, 48px);
  background: var(--surface);
  border-color: var(--line-strong);
}
.cta-mark {
  width: 46px; height: 46px; margin: 0 auto;
  display: grid; place-items: center;
  border: 1px solid var(--gold); border-radius: 50%;
  color: var(--gold); font-size: 23px; line-height: 1;
}
.cta-panel h2 {
  font-size: clamp(26px, 3.2vw, 36px); font-weight: 500;
  line-height: 1.35; letter-spacing: -.01em; margin: 20px 0 14px;
}
.cta-panel p { font-size: var(--fs-body); color: var(--ink-dim); }
.cta-open {
  margin: 24px auto 0; max-width: 380px;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  font-family: var(--sans);
}
.cta-open div {
  display: flex; justify-content: space-between; gap: 16px;
  padding: 11px 2px; border-bottom: 1px solid var(--line);
}
.cta-open div:last-child { border-bottom: 0; }
.cta-open dt { font-size: var(--fs-note); color: var(--ink-faint); letter-spacing: .14em; }
.cta-open dd { font-size: var(--fs-note); color: var(--ink); }
#notify { display: grid; gap: 12px; margin-top: 26px; }
#notify input {
  font-family: var(--sans); font-size: 14px;
  background: rgba(13, 12, 10, .7); color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: 10px;
  padding: 14px 16px; outline: none; text-align: center;
  transition: border-color .3s var(--ease);
}
#notify input:focus { border-color: var(--gold); }
#notify input::placeholder { color: var(--ink-faint); }
#notify button {
  font-family: var(--sans); font-size: 13px; font-weight: 700; letter-spacing: .2em;
  background: var(--gold); color: #171204;
  border: none; border-radius: 10px; padding: 15px 16px; cursor: pointer;
  transition: background .3s var(--ease), transform .3s var(--ease);
}
#notify button:hover { background: var(--gold-bright); transform: translateY(-2px); }
.cta-panel .done { margin-top: 22px; color: var(--gold); font-size: 15px; }

/* ── フッター ─────────────────────────────── */
.foot {
  padding: 40px clamp(18px, 4vw, 52px) 56px;
  border-top: 1px solid var(--line);
  background: rgba(10, 9, 7, .65);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-family: var(--sans); font-size: 12px; color: var(--ink-faint);
  display: grid; gap: 6px;
}

/* ── 出現アニメーション(JS 有効時のみ隠す)── */
.js [data-reveal] { opacity: 0; transform: translateY(30px); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js [data-reveal] { opacity: 1; transform: none; }
  .scroll-cue { animation: none; }
}

/* ──────────────────────────────────────────────────────────────
   和文タイポグラフィ調整
   1. palt        … 句読点・括弧まわりの余分なアキを詰める
   2. auto-phrase … 文節単位で折り返す（「書」「く。」のような分断を防ぐ）
   3. balance     … 見出しの行長を揃え、1文字だけ落ちる行を作らない
   4. strict      … 禁則処理を厳密にし、行頭に 。 、 」 が来ないようにする
   auto-phrase / balance / pretty は非対応ブラウザでは無視されるだけで、
   崩れることはない（プログレッシブ・エンハンスメント）。
   ────────────────────────────────────────────────────────────── */
body {
  font-feature-settings: "palt" 1;
  font-kerning: normal;
  line-break: strict;
  word-break: normal;
}
h1, h2, h3, h4, h5, .kicker, dt {
  word-break: auto-phrase;
  text-wrap: balance;
}
p, li, dd, td, .note, .desc, .caption,
.lede, .lead, .statement, blockquote, figcaption {
  word-break: auto-phrase;
  text-wrap: pretty;
}
/* 手動改行は広い画面でのみ効かせ、狭い画面では自動折り返しに任せる */
@media (max-width: 640px) {
  h1 br, h2 br, h3 br,
  .lede br, .lead br, .statement br { display: none; }
}

/* ── 書体設計（1 箇所に集約。以前は矛盾する 3 ブロックが積まれていた） ──
   見出し: 欧文 Cormorant Garamond / 和文 Zen Antique（版木の骨格を意匠に使う）
   本文  : BIZ UDPMincho（Google Fonts の和文で palt が効く数少ない書体）
   Shippori Mincho はどこにも当たらない死に読み込みだったので HTML 側から除去した。 */
h1, h2, h3, h4, .lede, .lead, .kicker, .statement, blockquote {
  font-family: var(--display);
}
html body :is(p, li, dd, dt, td, .note, .desc, .caption, figcaption, .body, .txt, .text, small):not(code):not(pre):not([class*="mono"]):not([class*="code"]) {
  font-family: var(--serif);
}
html body :is(.eyebrow, .links a, .plan-note, .cat-note, .foot, .scroll-cue, .hero-note, .w-panel .num, .w-panel .chips i, .w-meta dt, .cta-open dt, #notify input, #notify button) {
  font-family: var(--sans);
}
html body :is(.brand span, .w-panel h3 small, .cat-item .price) { font-family: var(--serif-en); }
html body .cat-item h3 { font-family: var(--display); }
