/* ============================================================
   灯火 — TOKA CERAMICS / Warm Craft 3D Site Template (EMBER)
   規律: アクセントはテラコッタ1色。緑・青は使わない。
   blob マスク・縦書き・重なりは各1ページ1回のシグネチャ使用。
   KILN 区間はトークン(--bg/--ink/--accent等)を JS が補間する。
   ============================================================ */

:root {
  --bg: #F6F1E7;
  --surface: #EFE6D6;
  --ink: #2B2118;
  --ink-muted: #6B5B4A;
  --line: #D8C9B4;
  --accent: #A9502B;

  /* KILN ダークテーマの色は main.js の THEME_KILN が正
     （JS がスクロールに応じて --bg 等へ補間して書き込む） */

  --font-ja: "Shippori Mincho", "Hiragino Mincho ProN", serif;
  --font-en: "Fraunces", Georgia, serif;

  --fs-display: clamp(2.6rem, 6.5vw + 1rem, 5.5rem);
  --fs-h2: clamp(1.8rem, 3.2vw + 0.6rem, 3rem);
  --fs-h3: clamp(1.25rem, 1.2vw + 0.9rem, 1.6rem);
  --fs-body: clamp(0.95rem, 0.25vw + 0.85rem, 1.0625rem);
  --fs-label: 0.75rem;

  --pad-x: clamp(20px, 4vw, 64px);
  --content-max: 1280px;
  --radius: 20px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: auto; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ja);
  font-size: var(--fs-body);
  line-height: 2.0;
  letter-spacing: 0.04em;
  overflow-x: hidden;
  transition: none; /* KILN 補間は JS 駆動のため CSS transition は切る */
}
::selection { background: var(--accent); color: var(--bg); }
img { display: block; max-width: 100%; }
a { color: inherit; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  clip-path: inset(50%); overflow: hidden; white-space: nowrap;
}
.skip-link {
  position: fixed; top: -56px; left: 16px; z-index: 100;
  padding: 10px 22px; background: var(--ink); color: var(--bg);
  text-decoration: none; font-size: 0.875rem; border-radius: 999px;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 16px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* ---- WebGL canvas ---- */
#gl { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; display: block; }
.no-webgl #gl { display: none; }
main { position: relative; z-index: 1; }

/* ---- セクションラベル ---- */
.sec-label {
  font-family: var(--font-en);
  font-weight: 500; font-size: var(--fs-label);
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 32px;
}

/* ---- Header ---- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px var(--pad-x);
  /* 写真・テーマ遷移の上でも判読できる半透明地。トークン連動で KILN の闇にも追従 */
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.logo { display: flex; align-items: baseline; gap: 12px; text-decoration: none; }
.logo-ja { font-family: var(--font-ja); font-weight: 600; font-size: 1.375rem; letter-spacing: 0.2em; }
.logo-en {
  font-family: var(--font-en); font-weight: 500;
  font-size: 0.6875rem; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-muted);
}
.site-header nav { display: flex; gap: clamp(14px, 2vw, 32px); align-items: center; }
.site-header nav a {
  font-size: 0.875rem; letter-spacing: 0.1em; text-decoration: none;
}
.site-header nav a:hover { color: var(--accent); }
.nav-cta {
  border: 1px solid var(--accent); color: var(--accent);
  padding: 8px 20px; border-radius: 999px;
}
.nav-cta:hover { background: var(--accent); color: var(--bg); }

/* ============================================================
   S1 HERO — 100vh / 呼吸する土塊（3D は右側）
   ============================================================ */
.hero {
  min-height: 100vh;
  display: flex; align-items: center;
  padding: 0 var(--pad-x);
}
.hero-inner { max-width: var(--content-max); margin: 0 auto; width: 100%; }
.hero-label {
  font-family: var(--font-en); font-weight: 500;
  font-size: var(--fs-label); letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-muted); margin-bottom: 24px;
}
.display {
  font-family: var(--font-en); font-weight: 300;
  font-size: var(--fs-display); line-height: 1.05;
  letter-spacing: -0.01em;
  max-width: 8em;
}
.js .display .dsp-en { opacity: 0; }
.hero-copy { margin-top: 32px; font-size: var(--fs-h3); line-height: 1.9; }
.js .hero-copy { opacity: 0; }

/* ============================================================
   S2 HANDS — 320vh / 土→器モーフ + 工程キャプション
   ============================================================ */
.hands { height: 320vh; position: relative; }
.hands-sticky {
  position: sticky; top: 0; height: 100vh;
  display: flex; align-items: center;
  padding: 0 var(--pad-x);
}
.hands-captions { position: relative; width: min(24em, 82vw); min-height: 12em; display: flex; align-items: center; }
.hand-cap { position: absolute; top: 50%; transform: translateY(-50%); }
.js .hand-cap { opacity: 0; }
/* JS 無効時は 3 段を縦に並べて全文可読にする */
html:not(.js) .hands-captions { display: block; }
html:not(.js) .hand-cap { position: static; transform: none; margin-bottom: 3em; }
.cap-no {
  font-family: var(--font-en); font-weight: 500;
  font-size: var(--fs-label); letter-spacing: 0.14em;
  color: var(--accent); margin-bottom: 16px;
}
.hand-cap h2 { font-size: var(--fs-h2); font-weight: 500; line-height: 1.5; }

/* ============================================================
   S3 PHILOSOPHY — 縦書き（1ページ1回のシグネチャ）
   ============================================================ */
.philosophy {
  min-height: 120vh;
  display: flex; align-items: center; justify-content: center;
  gap: clamp(40px, 8vw, 128px);
  padding: clamp(96px, 14vh, 160px) var(--pad-x);
}
.ph-vertical {
  writing-mode: vertical-rl;
  font-size: var(--fs-h2); font-weight: 500;
  letter-spacing: 0.28em; line-height: 2;
  height: 12em;
}
.ph-body { max-width: 24em; color: var(--ink-muted); }

/* ============================================================
   S4 COLLECTION — 260vh / 横スクロール
   ============================================================ */
.collection { height: 260vh; position: relative; }
.col-sticky {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; justify-content: center;
  overflow: hidden;
  padding: 0 0 0 var(--pad-x);
}
.col-track { display: flex; gap: clamp(24px, 3vw, 48px); width: max-content; align-items: center; will-change: transform; }
.col-card { width: min(480px, 78vw); }
.col-card img {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover;
  border-radius: var(--radius);
}
/* シグネチャ blob マスク（1枚のみ） */
.col-blob img { border-radius: 58% 42% 55% 45% / 48% 52% 48% 52%; }
.col-card figcaption {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-top: 16px; padding: 0 8px;
}
.col-name { font-size: var(--fs-h3); font-weight: 500; }
.col-price { font-family: var(--font-en); font-weight: 500; color: var(--accent); }

/* 写真の暖色トーン統一（全写真共通・2層） */
.col-card, .studio-photo, .studio-sub, .maker-photo { position: relative; }
.col-card img, .studio-photo img, .studio-sub img, .maker-photo img {
  filter: sepia(0.28) saturate(0.82) brightness(1.03) contrast(0.95) hue-rotate(-6deg);
}
.col-card::after, .studio-photo::after, .studio-sub::after, .maker-photo::after {
  content: ""; position: absolute; inset: 0;
  background: #B96A43; opacity: 0.14;
  mix-blend-mode: color; pointer-events: none;
  border-radius: var(--radius);
}
.col-card::after { inset: 0 0 3.4em 0; } /* キャプションを避ける */
.col-blob::after { border-radius: 58% 42% 55% 45% / 48% 52% 48% 52%; }

/* ============================================================
   S5 KILN — 140vh / 温度カウント + テーマ遷移
   ============================================================ */
.kiln { height: 140vh; position: relative; }
.kiln-sticky {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center; padding: 0 var(--pad-x);
}
.kiln-temp {
  font-family: var(--font-en); font-weight: 300;
  font-size: clamp(5rem, 16vw, 14rem); line-height: 1;
  font-variant-numeric: tabular-nums;
  color: var(--accent);
}
.kiln-unit { font-size: 0.35em; margin-left: 0.1em; }
.kiln-copy { margin-top: 24px; max-width: 28em; color: var(--ink-muted); }

/* ============================================================
   S6 STUDIO — マスク展開 + 重なり（シグネチャ）
   ============================================================ */
.studio { padding: clamp(96px, 14vh, 160px) var(--pad-x); }
.studio-inner {
  max-width: var(--content-max); margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(24px, 4vw, 64px); align-items: start;
}
.studio-photo img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; border-radius: var(--radius); }
.js .studio-photo { clip-path: inset(10% 10% 10% 10% round var(--radius)); }
.studio-text { margin-top: 64px; margin-left: -40px; }
.studio-text h2 { font-size: var(--fs-h2); font-weight: 500; line-height: 1.6; margin-bottom: 20px; }
.studio-text p { color: var(--ink-muted); max-width: 26em; }
.studio-sub { margin-top: 40px; max-width: 320px; }
.studio-sub img { border-radius: var(--radius); }

/* ============================================================
   S7 MAKERS — 緩い縦パララックス
   ============================================================ */
.makers { padding: clamp(96px, 14vh, 160px) var(--pad-x); }
.makers > .sec-label, .makers-list { max-width: var(--content-max); margin-left: auto; margin-right: auto; }
.makers-list { list-style: none; display: flex; flex-direction: column; gap: clamp(64px, 10vh, 104px); }
.maker {
  display: grid; grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: clamp(24px, 4vw, 64px); align-items: center;
}
.maker:nth-child(even) { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
.maker:nth-child(even) .maker-photo { order: 2; }
.maker-photo { overflow: hidden; border-radius: var(--radius); aspect-ratio: 16 / 11; }
.maker-photo img { width: 100%; height: 120%; object-fit: cover; will-change: transform; }
.maker-text h3 { font-size: var(--fs-h3); font-weight: 600; letter-spacing: 0.08em; }
.maker-role {
  font-family: var(--font-en); font-weight: 500;
  font-size: var(--fs-label); letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent); margin: 8px 0 16px;
}
.maker-text p:last-child { color: var(--ink-muted); }

/* ============================================================
   S8 CLASSES
   ============================================================ */
.classes { padding: clamp(96px, 14vh, 160px) var(--pad-x); }
.classes > * { max-width: var(--content-max); margin-left: auto; margin-right: auto; }
.classes-title { font-size: var(--fs-h2); font-weight: 500; line-height: 1.6; margin-bottom: 48px; }
.classes-grid {
  list-style: none;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}
.class-card {
  background: var(--surface);
  border-radius: var(--radius);
  padding: 36px 32px;
}
.class-card h3 { font-size: var(--fs-h3); font-weight: 600; margin-bottom: 8px; }
.class-price { font-family: var(--font-ja); color: var(--ink-muted); margin-bottom: 16px; }
.class-price .fr { font-family: var(--font-en); font-weight: 500; font-size: 1.5rem; color: var(--accent); }
.class-card p:last-child { color: var(--ink-muted); font-size: 0.9375rem; line-height: 1.9; }

/* ============================================================
   S9 OUTRO / CTA
   ============================================================ */
.cta {
  min-height: 110vh;
  display: flex; flex-direction: column; justify-content: center; align-items: center;
  text-align: center; padding: 0 var(--pad-x);
}
.cta h2 { font-size: var(--fs-display); font-weight: 500; letter-spacing: 0.1em; margin-bottom: 24px; }
.cta-copy { color: var(--ink-muted); margin-bottom: 40px; }
.btn {
  display: inline-block;
  font-family: var(--font-ja); font-weight: 600;
  font-size: 1.0625rem; letter-spacing: 0.1em;
  color: var(--bg); background: var(--accent);
  text-decoration: none;
  padding: 18px 48px; border-radius: 999px;
  transition: transform 0.3s ease; /* opacity は GSAP リビールと競合するため除外 */
}
.btn:hover, .btn:focus-visible { transform: translateY(-2px); }

/* ---- Footer ---- */
.site-footer {
  position: relative; z-index: 1;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px;
  padding: 24px var(--pad-x);
  border-top: 1px solid var(--line);
  font-size: 0.8125rem; color: var(--ink-muted);
}
.site-footer a { color: inherit; text-decoration: none; }
.site-footer a:hover { color: var(--ink); }

/* ============================================================
   Responsive
   ============================================================ */
/* ---- モバイルドロワー（≤860px のみ表示） ---- */
.mnav { display: none; position: relative; }
.mnav summary {
  list-style: none; cursor: pointer;
  font-size: 0.875rem; letter-spacing: 0.1em;
  border: 1px solid var(--line); border-radius: 999px;
  padding: 8px 18px;
}
.mnav summary::-webkit-details-marker { display: none; }
.mnav[open] summary { border-color: var(--accent); color: var(--accent); }
.mnav-panel {
  position: absolute; right: 0; top: calc(100% + 10px);
  min-width: 180px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex; flex-direction: column;
}
.mnav-panel a {
  text-decoration: none; font-size: 0.9375rem; letter-spacing: 0.1em;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
}
.mnav-panel a:last-child { border-bottom: none; }
.mnav-panel a:hover { color: var(--accent); }

@media (max-width: 860px) {
  .site-header nav { display: none; }
  .mnav { display: block; }
  .philosophy { flex-direction: column; }
  /* 縦書きシグネチャはデスクトップ限定。モバイルは横書きへ戻す */
  .ph-vertical { writing-mode: horizontal-tb; height: auto; min-height: 0; letter-spacing: 0.12em; }
  .studio-inner { grid-template-columns: 1fr; }
  .studio-text { margin-left: 0; margin-top: 24px; }
  .maker, .maker:nth-child(even) { grid-template-columns: 1fr; }
  .maker:nth-child(even) .maker-photo { order: 0; }
}

/* ============================================================
   Reduced Motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  #gl { opacity: 0.45; }
}

/* ──────────────────────────────────────────────────────────────
   和文タイポグラフィ調整
   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; }
}


/* ── 書体設計（見出し＝個性 / 本文＝可読性） ──────────────────────
   見出し: Klee One
   本文  : BIZ UDPMincho（Google Fonts の和文で palt が効く数少ない書体。
           読点のあとのアキが締まり、Mac / Windows で見え方が揃う）
   欧文は先頭に置いた書体から取り、和文だけが差し替わる。 */
h1, h2, h3, h4, .lede, .lead, .kicker, .statement, blockquote {
  font-family: "Fraunces", "Klee One", serif;
}
p, li, dd, td, .note, .desc, .caption, figcaption, small {
  font-family: "BIZ UDPMincho", "Hiragino Mincho ProN", "Yu Mincho", serif;
}


/* ── 本文書体の適用を確実にする ──
   サイト側に .card p のような具体的な指定があると本文書体が上書きされてしまうため、
   html body を前置きして優先度を上げる。等幅を意図した要素は除外する。 */
html body :is(p, li, dd, td, .note, .desc, .caption, figcaption, .body, .txt, .text):not(code):not(pre):not([class*="mono"]):not([class*="code"]) {
  font-family: "BIZ UDPMincho", "Hiragino Mincho ProN", "Yu Mincho", serif;
}
