:root {
  --ink: #1C2836;
  --paper: #F3F0E8;
  --light: #EEF3F4;
  --fg: var(--ink);
  --ease: cubic-bezier(.2, .7, .2, 1);
}
* { box-sizing: border-box; }
html { background: var(--paper); }
body {
  margin: 0;
  color: var(--fg);
  font-family: 'Zen Kaku Gothic New', sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: color .8s var(--ease);
}
body[data-theme="light"] { --fg: var(--light); }
a { color: inherit; text-decoration: none; }
a:hover { opacity: .65; }
button { font: inherit; color: inherit; }
.mincho { font-family: 'Shippori Mincho', serif; }
.lat { font-family: 'Hanken Grotesk', sans-serif; letter-spacing: .2em; text-transform: uppercase; font-size: 11px; }

#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; animation: fadein 1.6s ease both; }
@keyframes fadein { from { opacity: 0; } }
#track { height: 1100vh; } /* 実際の高さは main.js が画面の高さから決める */
/* 画面全体にかかる、紙のような細かい粒子 */
.grain {
  position: fixed; inset: 0; z-index: 30; pointer-events: none; opacity: .07;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .6 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* ---------- nav ---------- */
.nav {
  position: fixed; z-index: 20; left: 0; right: 0; top: 0; height: 96px;
  display: flex; align-items: center; justify-content: space-between; padding: 0 56px;
}
.logo { display: flex; align-items: baseline; gap: 14px; padding: 12px 0; }
.logo .mincho { font-size: 30px; font-weight: 500; }
.nav-links { display: flex; align-items: center; gap: 44px; font-size: 13px; letter-spacing: .24em; }
.nav-links a { padding: 14px 0; }
.nav-links .store { padding-bottom: 6px; border-bottom: 1px solid currentColor; white-space: nowrap; }
.lang { display: flex; align-items: center; gap: 4px; margin-left: -12px; }
.lang button { min-width: 32px; padding: 16px 4px; border: 0; background: none; cursor: pointer; opacity: .5; transition: opacity .3s; }
.lang button[aria-pressed="true"], .lang button:hover { opacity: 1; }
.lang i { font-style: normal; font-size: 11px; opacity: .45; }

/* ---------- rail ---------- */
.rail {
  position: fixed; z-index: 20; left: 56px; top: 50%; transform: translateY(-50%);
  margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 4px;
}
.rail button {
  display: flex; align-items: center; gap: 12px; height: 36px; padding: 0; border: 0; background: none;
  font-size: 12px; letter-spacing: .22em; cursor: pointer; opacity: .7; transition: opacity .5s;
}
.rail button i { display: block; width: 12px; height: 1px; background: currentColor; transition: width .6s var(--ease); }
.rail button[aria-current="true"] { opacity: 1; }
.rail button[aria-current="true"] i { width: 32px; }
.rail button:hover { opacity: 1; }
.rail button em { font-style: normal; display: none; }
.rail button[aria-current="true"] em { display: inline; }

/* ---------- acts ---------- */
.act { position: fixed; inset: 0; z-index: 10; pointer-events: none; visibility: hidden; }
.act.on { visibility: visible; }
.act > * { opacity: 0; transform: translateY(18px); transition: opacity .9s var(--ease), transform 1.2s var(--ease); }
.act.on > * { opacity: 1; transform: none; }
.act.on > *:nth-child(2) { transition-delay: .12s; }
.act.on > *:nth-child(3) { transition-delay: .24s; }
.act.on > *:nth-child(4) { transition-delay: .36s; }
.act.on > *:nth-child(5) { transition-delay: .48s; }

.vhead {
  position: absolute; margin: 0; writing-mode: vertical-rl; font-weight: 500;
  font-size: clamp(44px, 6vw, 86px); line-height: 1.55; letter-spacing: .12em;
}
.eyebrow { font-size: 12px; letter-spacing: .28em; }
/* 大見出しに添える縦の欧文。英語表示では見出しの短い訳になる */
.vlat { position: absolute; writing-mode: vertical-rl; text-orientation: sideways; white-space: nowrap; }
.en-only { display: none; }
body[data-lang="en"] .en-only { display: block; }
.wind-hint em { font-style: normal; }
.intro { position: absolute; left: 200px; width: 350px; display: flex; flex-direction: column; gap: 22px; }
.intro p, .panel p { margin: 0; font-size: 15px; line-height: 2.1; letter-spacing: .06em; }

/* 01 */
.act1 .vhead { right: 13vw; top: 17vh; }
.act1 .vlat { right: 8.5vw; top: 18vh; }
.act1 .intro { bottom: 23vh; }
.wind-hint { position: absolute; left: 44vw; top: 44vh; display: flex; align-items: center; gap: 14px; font-size: 12px; letter-spacing: .24em; }
.wind-hint span { width: 44px; height: 44px; border-radius: 50%; border: 1px solid currentColor; animation: pulse 3s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.35); opacity: .35; } }
.scroll-hint { position: absolute; left: 0; right: 0; bottom: 6vh; display: flex; flex-direction: column; align-items: center; gap: 12px; font-size: 12px; letter-spacing: .24em; }
.scroll-hint i { width: 1px; height: 56px; background: currentColor; transform-origin: top; animation: drop 2.4s var(--ease) infinite; }
@keyframes drop { 0% { transform: scaleY(0); } 60% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }

/* 02 */
.act2 .vhead { right: 17vw; top: 19vh; font-size: clamp(42px, 5.6vw, 80px); line-height: 1.6; }
.act2 .intro { bottom: 13vh; width: 330px; }
.gauge { position: absolute; right: 64px; top: 28vh; height: 44vh; display: flex; gap: 18px; }
.gauge ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-end; }
.gauge li { display: flex; align-items: center; gap: 12px; font-size: 14px; letter-spacing: .2em; opacity: .6; transition: opacity .6s, font-size .6s var(--ease); }
.gauge li b { width: 10px; height: 10px; border-radius: 50%; border: 1px solid rgba(238, 243, 244, .6); transition: transform .6s var(--ease); }
.gauge li.cur { opacity: 1; font-size: 19px; }
.gauge li.cur b { transform: scale(1.5); }
.gauge-line { position: relative; width: 1px; background: rgba(238, 243, 244, .35); }
.gauge-line i { position: absolute; left: 0; top: 0; width: 1px; height: 0; background: var(--light); }
.gauge-note { position: absolute; right: 64px; bottom: 13vh; text-align: right; font-size: 12px; line-height: 2.2; letter-spacing: .16em; }

/* 03 */
.act3 .vhead { left: 200px; top: 15vh; font-size: clamp(36px, min(4.2vw, 7vh), 60px); line-height: 1.5; }
.body3 { position: absolute; left: 200px; top: 63vh; width: 250px; margin: 0; font-size: 14px; line-height: 2.1; letter-spacing: .06em; }
.scrub { position: absolute; left: calc(var(--cloth-r, calc(50% + 26vh)) + 52px); top: 44vh; width: min(300px, 22vw); display: flex; flex-direction: column; gap: 14px; }
.scrub-head, .scrub-names { display: flex; justify-content: space-between; font-size: 12px; letter-spacing: .2em; }
.scrub-names { font-family: 'Shippori Mincho', serif; font-size: 15px; }
.scrub-track { position: relative; height: 12px; }
.scrub-track::before { content: ""; position: absolute; left: 0; right: 0; top: 5px; height: 2px; background: linear-gradient(90deg, #BDBE5C, #3B9597 50%, #2B6A99); }
.scrub-track i { position: absolute; top: 0; left: 0; width: 12px; height: 12px; margin-left: -6px; border-radius: 50%; background: var(--paper); border: 1px solid var(--ink); }

/* 04 */
.center4 { position: absolute; left: 0; right: 0; bottom: 9vh; display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; padding: 0 24px; }
.center4 h2 { margin: 0; font-size: clamp(28px, 3.5vw, 50px); font-weight: 500; line-height: 1.4; letter-spacing: .14em; }
.center4 p { margin: 0; font-size: 14px; line-height: 2; letter-spacing: .08em; }

/* 05 */
/* 色名ラベルの入れ物は画面全体を覆うので、入れ物自体はクリックを通し、ボタンだけが受ける */
.act5.on .panel, .act5.on .swatch-labels button, .act5.on .foot { pointer-events: auto; }
.panel { position: absolute; left: 200px; top: 50%; margin-top: -270px; width: 320px; display: flex; flex-direction: column; gap: 26px; }

.touch-hint { display: none; opacity: .75; }
/* 干し場の布に付く色名の札 */
.yard-labels { position: fixed; inset: 0; z-index: 10; pointer-events: none; overflow: hidden; }
.ylabel {
  position: absolute; left: 0; top: 0; display: flex; flex-direction: column; gap: 7px; opacity: 0; white-space: nowrap; will-change: transform, opacity;
  padding: 14px 18px 16px; background: rgba(246, 243, 236, .94); color: var(--ink); box-shadow: 0 6px 18px rgba(40, 60, 90, .10);
}
.ylabel.r { align-items: flex-end; }
.ylabel i { width: 28px; height: 1px; background: currentColor; margin-bottom: 4px; }
.ylabel .mincho { font-size: clamp(20px, 2vw, 28px); letter-spacing: .12em; line-height: 1.1; }
.ylabel .note { font-size: 12px; letter-spacing: .16em; }
.name-row { display: flex; align-items: flex-end; gap: 20px; }
.name-row h2 { margin: 0; font-size: 128px; font-weight: 500; line-height: 1; white-space: nowrap; transition: opacity .4s; }
.name-row h2.two { font-size: 96px; }
.name-sub { display: flex; flex-direction: column; gap: 8px; padding-bottom: 14px; font-size: 13px; letter-spacing: .3em; }
.pills { display: flex; flex-wrap: wrap; gap: 10px; }
.pill { height: 44px; padding: 0 20px; border-radius: 22px; border: 1px solid rgba(28, 40, 54, .45); background: none; font-size: 13px; letter-spacing: .14em; cursor: pointer; transition: background .3s, color .3s; }
.pill[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.product { display: flex; justify-content: space-between; align-items: baseline; padding-top: 18px; border-top: 1px solid rgba(28, 40, 54, .3); }
.product > div { display: flex; flex-direction: column; gap: 6px; font-size: 12px; letter-spacing: .1em; }
.product .mincho { font-size: 19px; }
.price { font-family: 'Hanken Grotesk', sans-serif; font-size: 18px; letter-spacing: .06em; }
.buy { display: flex; align-items: center; gap: 24px; }
.cart { height: 54px; padding: 0 34px; border: 0; background: var(--ink); color: var(--paper); font-size: 13px; letter-spacing: .24em; cursor: pointer; transition: background .3s; }
.cart:hover { background: #2E6F9E; }
.buy a { font-size: 12px; letter-spacing: .16em; padding: 16px 0 6px; border-bottom: 1px solid currentColor; }
.swatch-labels { position: absolute; inset: 0; }
.swatch-labels button {
  position: absolute; left: 0; top: 0; width: 90px; margin-left: -45px; min-height: 60px; padding: 6px 0; border: 0; background: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
}
.swatch-labels .mincho { font-size: 17px; letter-spacing: .14em; }
.swatch-labels .lat { font-size: 10px; letter-spacing: .14em; }
.swatch-labels button::after { content: ""; width: 0; height: 1px; background: currentColor; transition: width .5s var(--ease); }
.swatch-labels button[aria-pressed="true"]::after { width: 28px; }
.swatch-labels button[aria-pressed="true"] .mincho { font-weight: 600; }
.foot { position: absolute; left: 56px; right: 56px; bottom: 0; height: 72px; border-top: 1px solid rgba(28, 40, 54, .25); display: flex; align-items: center; justify-content: space-between; font-size: 12px; letter-spacing: .2em; }
.foot div { display: flex; gap: 36px; }
.foot-note { opacity: .75; }
.concept-m { display: none; font-size: 11px; letter-spacing: .08em; opacity: .75; }
/* 撮影用の静止表示（?still=）では、出だしのフェードを省く */
body.still #gl { animation: none; }
body.still .act > *, body.still { transition: none !important; }
/* JavaScript や WebGL が使えないときの案内 */
.notice { position: fixed; z-index: 40; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(520px, 84vw); margin: 0; padding: 28px 32px; background: var(--paper); color: var(--ink); font-size: 14px; line-height: 2; text-align: center; }
.webgl-notice { display: none; }
body.no-webgl .webgl-notice { display: block; }
body.no-webgl .act, body.no-webgl .rail { display: none; }
.foot a { padding: 14px 0; }

/* ---------- English ---------- */
/* 漢字の見出しと色名はそのまま、説明と操作まわりだけ欧文の組み方に変える */
.act2 .vlat { right: calc(17vw + 3.2 * clamp(42px, 5.6vw, 80px) + 16px); top: 20vh; }
.act3 .vlat { writing-mode: horizontal-tb; left: 200px; top: calc(63vh - 34px); }
body[data-lang="en"] { font-family: 'Hanken Grotesk', 'Zen Kaku Gothic New', sans-serif; }
body[data-lang="en"] :is(.intro p, .panel p, .body3, .center4 p) { font-size: 15px; line-height: 1.75; letter-spacing: .015em; }
body[data-lang="en"] .center4 p { max-width: 30em; }
body[data-lang="en"] :is(.nav-links a, .eyebrow, .rail button, .wind-hint, .scroll-hint, .scrub-head, .foot, .cart) { font-size: 11px; letter-spacing: .18em; text-transform: uppercase; }
body[data-lang="en"] .gauge-note { letter-spacing: .04em; line-height: 1.9; font-size: 13px; }
body[data-lang="en"] .name-sub { letter-spacing: .04em; font-size: 14px; }
body[data-lang="en"] .pill { letter-spacing: .06em; }
body[data-lang="en"] .product > div { letter-spacing: .02em; }
body[data-lang="en"] .buy a { letter-spacing: .04em; font-size: 13px; white-space: nowrap; }
body[data-lang="en"] .cart { padding: 0 26px; white-space: nowrap; }
body[data-lang="en"] .panel { left: 236px; } /* 左の場面名に英語が付くぶん、右へ寄せる */
body[data-lang="en"] .ylabel .note { letter-spacing: .05em; }
body[data-lang="en"] .intro p i { font-style: italic; }

/* ---------- 中間の幅（小さめのノートPC、横向きのタブレット） ---------- */
/* 左の場面メニューを隠して文字を左端へ寄せる。布の位置は main.js が文字の右端を測って決める */
@media (min-width: 901px) and (max-width: 1350px) {
  .rail { display: none; }
  .intro, .body3, .act3 .vhead, .act3 .vlat { left: 56px; }
  .panel, body[data-lang="en"] .panel { left: 56px; width: clamp(280px, 30vw, 320px); }
  .name-row h2 { font-size: clamp(88px, 9.5vw, 128px); }
  .name-row h2.two { font-size: clamp(64px, 7vw, 96px); }
  .name-row { gap: 14px; }
  .foot-tag { display: none; }
  /* 発色の場面では布がメニューの下に来るので、上端を紙の色でやわらかく霞ませて文字を読めるようにする */
  .nav::before {
    content: ""; position: absolute; left: 0; right: 0; top: 0; height: 112px; z-index: -1; pointer-events: none;
    background: linear-gradient(rgba(243, 240, 232, .9), rgba(243, 240, 232, .6) 50%, rgba(243, 240, 232, 0));
    opacity: 0; transition: opacity .8s var(--ease);
  }
  body[data-scrim="1"] .nav::before { opacity: 1; }
}
/* 高さの足りない画面では、商品パネルを少し詰める */
@media (min-width: 901px) and (max-height: 760px) {
  .panel { gap: 16px; margin-top: -225px; }
  .name-row h2 { font-size: 96px; }
  .name-row h2.two { font-size: 72px; }
}
/* 布の間隔が狭いときは、色名のローマ字を省いて漢字だけにする */
.swatch-labels.compact button { width: 56px; margin-left: -28px; }
.swatch-labels.compact .lat { display: none; }
.swatch-labels.compact .mincho { font-size: 15px; letter-spacing: .08em; }

/* ---------- narrow screens ---------- */
@media (max-width: 900px) {
  .lang { margin-left: -24px; }
  .act2 .vlat { right: calc(36vw + 140px); top: 14vh; }
  .act3 .vlat { left: 24px; top: calc(46vh - 46px); width: 40vw; white-space: normal; line-height: 1.7; }
  body[data-lang="en"] :is(.intro p, .panel p, .body3) { font-size: 13px; }
  body[data-lang="en"] .buy { gap: 14px; }
  body[data-lang="en"] .panel { left: 24px; }
  .nav { padding: 0 20px; height: 72px; }
  .nav-links a:not(.store) { display: none; }
  .rail { display: none; }
  .intro, .act2 .intro { left: 24px; width: min(300px, 70vw); }
  .intro p { font-size: 14px; }
  .act1 .vhead { right: 10vw; top: 14vh; }
  .act1 .intro { bottom: 20vh; }
  .wind-hint { display: none; }
  .act2 .vhead { right: 36vw; top: 13vh; font-size: 40px; }
  .gauge { right: 16px; top: 15vh; height: 34vh; }
  .gauge li { font-size: 13px; }
  .gauge li.cur { font-size: 16px; }
  .gauge-note { display: none; }
  .act3 .vhead { left: 24px; top: 12vh; font-size: 34px; }
  .body3 { left: 24px; top: 46vh; width: 40vw; font-size: 13px; line-height: 2; }
  .scrub { left: 24px; top: 74vh; width: 40vw; gap: 10px; }
  .scrub-names { font-size: 13px; }
  .center4 h2 span { display: inline-block; }
  .touch-hint { display: inline; }
  .ylabel { padding: 10px 12px 12px; gap: 5px; }
  .ylabel .note { font-size: 11px; }
  .panel { left: 24px; right: 24px; width: auto; top: auto; bottom: 20px; margin: 0; gap: 14px; padding: 20px; background: rgba(243, 240, 232, .88); backdrop-filter: blur(10px); }
  .name-row h2, .name-row h2.two { font-size: 56px; }
  .panel p { font-size: 13px; line-height: 1.9; }
  .foot, .swatch-labels { display: none; }
  .concept-m { display: block; }
  .act1 .intro { bottom: 25vh; }
  .cart { padding: 0 22px; white-space: nowrap; }
  .buy a { white-space: nowrap; }
}
/* 縦長のスマホ：商品パネルを低く詰めて、上の布の列に場所を空ける（タブレットの縦向きには当てない） */
@media (max-width: 520px) and (orientation: portrait) {
  .panel, body[data-lang="en"] .panel { left: 16px; right: 16px; bottom: 14px; padding: 16px 18px; gap: 12px; }
  .name-row { gap: 14px; align-items: center; }
  .name-row h2, .name-row h2.two { font-size: 46px; }
  .name-sub { padding-bottom: 0; gap: 4px; }
  .panel p { line-height: 1.75; }
  .pills { flex-wrap: nowrap; gap: 8px; }
  .pill { height: 40px; padding: 0 16px; font-size: 12px; }
  .product { padding-top: 12px; }
  .product .mincho { font-size: 17px; }
  .price { font-size: 16px; }
  .cart { height: 46px; }
  .concept-m { font-size: 10px; }
}
/* ごく狭い画面（320px 前後）では、ロゴを「汀」だけにしてヘッダーを一行に収める */
@media (max-width: 360px) {
  .nav { padding: 0 16px; }
  .logo .lat { display: none; }
  .nav-links { gap: 36px; }
  .touch-hint { display: none; }
  .pill { padding: 0 13px; }
  .cart, body[data-lang="en"] .cart { padding: 0 16px; }
  .buy, body[data-lang="en"] .buy { gap: 12px; }
  .product > div { font-size: 11px; }
}
/* 横長で幅の狭い画面（768px 前後のウィンドウなど）：商品パネルを下端の横長の帯にして、
   その上の広い空きに布の列を大きく置く */
@media (max-width: 900px) and (orientation: landscape) {
  .panel, body[data-lang="en"] .panel {
    left: 16px; right: 16px; width: auto; bottom: 12px; padding: 16px 22px;
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 36px; row-gap: 10px; align-items: center;
    grid-template-areas: "eyebrow pills" "name pills" "desc product" "note buy";
  }
  .panel > .eyebrow { grid-area: eyebrow; }
  .panel > .name-row { grid-area: name; align-items: center; gap: 14px; }
  .panel > p { grid-area: desc; line-height: 1.75; }
  .panel > .pills { grid-area: pills; flex-wrap: nowrap; gap: 8px; }
  .panel > .product { grid-area: product; padding-top: 12px; }
  .panel > .buy { grid-area: buy; }
  .panel > .concept-m { grid-area: note; }
  .name-row h2, .name-row h2.two { font-size: 50px; }
  .name-sub { padding-bottom: 0; }
  .pill { height: 40px; padding: 0 16px; }
  .cart { height: 46px; }
}
@media (prefers-reduced-motion: reduce) {
  .wind-hint span, .scroll-hint i { animation: none; }
}
