/* =========================================================
   'ilo 作品詳細（works/01〜07）・404 のスタイル
   レイヤー: 糸(1) → 本文・画像(2)。画像の背面を糸がくぐる
   ========================================================= */

/* ---------- ページ遷移（クロスドキュメント View Transitions。オプトインは base.css） ---------- */
.site-header { view-transition-name: site-header; }
::view-transition-group(*) { animation-duration: .75s; animation-timing-function: var(--ease); }
::view-transition-old(root) { animation: .45s var(--ease) both vtOut; }
::view-transition-new(root) { animation: .6s var(--ease) .1s both vtIn; }
@keyframes vtOut { to { opacity: 0; } }
@keyframes vtIn { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  ::view-transition-group(*), ::view-transition-old(*), ::view-transition-new(*) { animation: none !important; }
}

/* ---------- 共通 ---------- */
.seg { display: inline-block; }
.w-main .draft, .nf .draft { white-space: nowrap; }

/* ---------- 糸 ---------- */
.w-main { position: relative; }
.w-main > *:not(.w-thread) { position: relative; z-index: 2; }
.w-thread {
  position: absolute; left: 0; top: 0; width: 100%; height: 100%;
  z-index: 1; pointer-events: none; overflow: visible;
}

/* ---------- 見出し（TOP の sec-title を一段小さくした形） ---------- */
.w-sec { padding: var(--space-l) var(--gutter); }
.w-sec__title { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; margin: 0; font-weight: 400; }
.w-sec__en {
  font-family: var(--f-display); font-weight: 300;
  font-size: clamp(44px, 5.2vw, 80px); line-height: .9; letter-spacing: -.006em;
  font-kerning: normal; font-feature-settings: "kern" 1;
  font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 0;
  margin-left: -.04em;
}
.w-sec__ja { font-size: 12.5px; font-weight: 500; letter-spacing: .3em; color: var(--mute); padding-left: 2px; }

/* PC は「見出し 4 : 本文 8」の2カラム */
@media (min-width: 901px) {
  .w-split, .w-ov, .w-note, .w-contact {
    display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); column-gap: clamp(32px, 4vw, 72px); align-items: start;
  }
}

/* ---------- タイトル ---------- */
.w-hero {
  padding: calc(var(--header-h) + clamp(56px, 12vh, 132px)) var(--gutter) var(--space-m);
  display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: end;
  column-gap: clamp(28px, 4.4vw, 80px);
}
.w-hero__no {
  display: flex; align-items: baseline; gap: .3em;
  font-family: var(--f-display); font-weight: 300; line-height: .8;
  font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 0;
  letter-spacing: -.02em; font-kerning: normal;
}
.w-hero__no-n { font-size: clamp(112px, 17vw, 264px); margin-left: -.05em; }
.w-hero__no-of { font-size: clamp(18px, 1.6vw, 24px); letter-spacing: 0; color: var(--mute); font-style: italic; }
.w-hero__body { padding-bottom: clamp(6px, 1.4vw, 22px); max-width: 44em; }
.w-hero__title { display: flex; flex-direction: column; gap: clamp(10px, 1.4vw, 18px); font-weight: 400; }
.w-hero__name { font-size: clamp(15px, 1.25vw, 18px); font-weight: 500; letter-spacing: .16em; }
.w-hero__name [lang="en"], .w-hero__name [lang="fr"], .w-hero__name [lang="es"] {
  font-family: var(--f-display); font-weight: 400; font-size: 1.22em; letter-spacing: .02em;
  font-variation-settings: "opsz" 24, "SOFT" 100, "WONK" 0;
}
.w-hero__name .w-hero__name-en { font-size: .82em; letter-spacing: .24em; margin-left: .5em; color: var(--mute); }
.w-hero__name-yomi { font-size: .78em; color: var(--mute); margin-left: .9em; letter-spacing: .2em; }
.w-hero__catch {
  font-size: clamp(28px, 4.3vw, 66px); line-height: 1.4; letter-spacing: .06em; font-weight: 500;
  text-wrap: balance;
}
.w-hero__en {
  margin-top: clamp(14px, 1.6vw, 22px);
  font-family: var(--f-display); font-style: italic; font-weight: 300;
  font-size: clamp(16px, 1.35vw, 20px); letter-spacing: .01em; line-height: 1.5; color: var(--mute);
  font-variation-settings: "opsz" 24, "SOFT" 100, "WONK" 0;
}
.w-hero__tags { display: flex; flex-wrap: wrap; gap: 10px; margin-top: clamp(22px, 2.6vw, 36px); }
.w-tag {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 12.5px; letter-spacing: .08em; line-height: 1;
  padding: 9px 15px 10px; border: 1px solid var(--line-strong); border-radius: 999px;
}

/* 読み込み時に一度だけ：番号とタイトルが布から浮かぶ */
.js .w-hero__no-n, .js .w-hero__catch, .js .w-hero__name, .js .w-hero__en, .js .w-hero__tags {
  animation: heroIn 1.2s var(--ease) both;
}
.js .w-hero__no-n { animation-name: heroNo; animation-duration: 1.5s; }
.js .w-hero__name { animation-delay: .15s; }
.js .w-hero__catch { animation-delay: .25s; }
.js .w-hero__en { animation-delay: .45s; }
.js .w-hero__tags { animation-delay: .55s; }
@keyframes heroIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes heroNo { from { opacity: 0; clip-path: inset(0 0 100% 0); transform: translateY(24px); } to { opacity: 1; clip-path: inset(0 0 -10% 0); transform: none; } }

/* ---------- 概要 ---------- */
.w-ov__list { border-top: 1px solid var(--line); }
.w-ov__row {
  display: grid; grid-template-columns: 7.5em minmax(0, 1fr); gap: 16px;
  padding: 16px 0 17px; border-bottom: 1px solid var(--line);
  font-size: 14.5px; line-height: 1.95;
}
.w-ov__row dt { color: var(--mute); font-size: 13px; letter-spacing: .16em; padding-top: 1px; }
.w-ov__row dd { margin: 0; }

/* ---------- キービジュアル ---------- */
.w-kv { margin: var(--space-m) var(--gutter) 0; }
.w-kv__frame { border-radius: 6px; overflow: hidden; background: var(--kinari); box-shadow: 0 0 0 1px var(--line); }
.w-kv__img { width: 100%; }

/* ---------- 課題設定 ---------- */
.w-lead { font-size: clamp(15.5px, 1.2vw, 17px); line-height: 2.25; max-width: 36em; }
.w-split .w-split__text { padding-top: 6px; }

/* ---------- デザインの答え ---------- */
.w-design > .w-sec__title { margin-bottom: clamp(40px, 6vh, 72px); }
.w-answer { padding: clamp(36px, 5vh, 56px) 0; border-top: 1px solid var(--line); }
.w-answer__title {
  display: flex; align-items: center; gap: 14px;
  font-size: clamp(19px, 1.6vw, 23px); font-weight: 500; letter-spacing: .2em; margin-bottom: 26px;
}
.w-answer__title::before { content: ""; width: 26px; height: var(--thread-w); background: var(--thread); border-radius: 1px; }
.w-answer__text { max-width: 36em; margin-top: 28px; }
@media (min-width: 901px) {
  .w-answer { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); column-gap: clamp(32px, 4vw, 72px); }
  .w-answer__title { margin-bottom: 0; align-self: start; padding-top: 4px; }
}

/* 配色：生地の反物のように、使う量の比率で並べる */
.w-bolt {
  display: flex; height: clamp(110px, 13vw, 180px);
  border-radius: 4px; overflow: hidden;
  box-shadow: 0 0 0 1px var(--line);
}
.w-bolt__seg {
  flex: var(--w) 1 0; background-color: var(--c); position: relative;
  /* ごく薄い織り目 */
  background-image:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, .07) 0 1px, transparent 1px 3px),
    repeating-linear-gradient(90deg, rgba(0, 0, 0, .035) 0 1px, transparent 1px 3px);
}
.w-bolt__seg + .w-bolt__seg { box-shadow: -1px 0 0 rgba(46, 40, 38, .08); }
.w-anim .w-bolt__seg { transform-origin: left center; transition: transform 1.1s var(--ease); }
.w-anim .w-bolt:not(.is-in) .w-bolt__seg { transform: scaleX(0); }
.w-anim .w-bolt__seg:nth-child(2) { transition-delay: .12s; }
.w-anim .w-bolt__seg:nth-child(3) { transition-delay: .24s; }
.w-colors { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 20px 28px; margin-top: 24px; }
.w-color { display: grid; grid-template-columns: 34px 1fr; grid-template-rows: auto auto auto; column-gap: 14px; line-height: 1.6; }
.w-color__chip { grid-row: 1 / 4; width: 34px; height: 34px; border-radius: 50%; background: var(--c); box-shadow: inset 0 0 0 1px rgba(46, 40, 38, .14); margin-top: 2px; }
.w-color__name { font-size: 14px; font-weight: 500; }
.w-color__hex { font-family: var(--f-en); font-size: 17px; letter-spacing: .06em; font-variant-numeric: lining-nums tabular-nums; }
.w-color__approx { font-size: .6em; color: var(--thread); margin-left: 2px; }
.w-color__role { font-size: 12.5px; color: var(--mute); letter-spacing: .06em; }
.w-color__note { margin-top: 14px; font-size: 12px; color: var(--mute); line-height: 1.8; }
.w-color__note sup { color: var(--thread); }

/* 書体：実際の書体で見本を組む */
.w-fonts { display: grid; gap: 16px; }
.w-fonts--2 { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.w-font {
  margin: 0; display: flex; flex-direction: column; justify-content: space-between; gap: 28px;
  padding: clamp(26px, 3vw, 44px); min-height: 220px;
  background: var(--kinari); border-radius: 4px;
}
.w-font__sample { font-size: clamp(24px, 2.6vw, 40px); line-height: 1.5; letter-spacing: .04em; font-feature-settings: normal; overflow-wrap: anywhere; }
.w-font--v .w-font__sample { writing-mode: vertical-rl; height: 9em; font-size: clamp(22px, 2.2vw, 32px); letter-spacing: .18em; align-self: center; }
.w-font__cap { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px; border-top: 1px solid var(--line); padding-top: 14px; }
.w-font__name { font-family: var(--f-en); font-size: 19px; letter-spacing: .04em; font-style: italic; }
.w-font__role { font-size: 12.5px; color: var(--mute); letter-spacing: .08em; }

/* 導線：糸を運針で進むように、読む順に並べる */
.w-route {
  position: relative; display: grid; grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); row-gap: 28px;
}
/* 運針：一歩ごとに破線をひと区切り持たせる（折り返しても途切れない） */
.w-route__step::before {
  content: ""; position: absolute; left: 0; right: 0; top: 10px; height: var(--thread-w);
  background: repeating-linear-gradient(90deg, var(--thread) 0 14px, transparent 14px 22px);
  opacity: .85;
}
.w-route__step { position: relative; padding: 30px 14px 0 0; font-size: 13.5px; line-height: 1.75; letter-spacing: .06em; }
.w-route__knot { position: absolute; left: 0; top: 3px; width: var(--thread-w); height: 15px; background: var(--sumi); transform: rotate(18deg); border-radius: 1px; }
.w-route__label { display: block; text-wrap: balance; }
.w-route__step:last-child .w-route__label { color: var(--thread); font-weight: 600; }
.w-route__aside { margin-top: 18px; font-size: 13px; color: var(--mute); letter-spacing: .06em; }
.w-route__aside::before { content: "＊"; color: var(--thread); margin-right: .3em; }

/* ---------- 画面ギャラリー ---------- */
.w-gallery > .w-sec__title { margin-bottom: clamp(32px, 5vh, 56px); }
.w-gallery__grid { display: grid; grid-template-columns: minmax(0, 1fr) clamp(170px, 17vw, 250px); gap: clamp(28px, 4vw, 72px); align-items: stretch; }
.w-gallery__track { position: relative; min-width: 0; }
.w-gallery__side { min-width: 0; }
.w-gallery__side .w-phone { position: sticky; top: calc(var(--header-h) + 12px + var(--phone-top, 40px)); }
.w-pc { margin: 0; min-width: 0; }
.w-pc__bar {
  display: flex; gap: 6px; align-items: center; height: 26px; padding: 0 12px;
  background: var(--kinari); border-radius: 6px 6px 0 0; box-shadow: 0 0 0 1px var(--line);
}
.w-pc__bar i { width: 7px; height: 7px; border-radius: 50%; background: rgba(46, 40, 38, .2); }
.w-pc__screen {
  position: relative; overflow: hidden; height: min(68vh, 640px);
  background: var(--white); border-radius: 0 0 6px 6px; box-shadow: 0 0 0 1px var(--line);
}
.w-pc__img { width: 100%; will-change: transform; }
.w-cap { display: flex; align-items: center; gap: 16px; margin-top: 14px; font-size: 12.5px; color: var(--mute); letter-spacing: .1em; }
.w-pc__meter { flex: 1; max-width: 220px; height: 1px; background: var(--line); position: relative; }
.w-pc__meter i { position: absolute; left: 0; top: -.3px; height: var(--thread-w); width: 100%; background: var(--thread); transform-origin: left; transform: scaleX(var(--p, 0)); }
.w-phone { margin: 0; }
.w-phone__body {
  padding: 9px; border-radius: 30px; background: var(--sumi);
  box-shadow: 0 30px 60px -36px var(--shadow-device);
}
.w-phone__img { width: 100%; border-radius: 22px; background: var(--white); }
.w-phone .w-cap { justify-content: center; }

/* スクロール連動（JS有効・動きを減らさない設定のとき）：
   ステージを固定して、PC画面の中をゆっくり下までたどる */
.is-scrub .w-gallery__stage { position: sticky; top: calc(var(--header-h) + 12px); }
.is-scrub .w-pc__screen { height: calc(100svh - var(--header-h) - 26px - 72px); max-height: 760px; }
.is-scrub .w-pc__screen:focus-visible { outline-offset: 4px; }
/* JS無効・reduced-motion：枠の中を自分でスクロールして見る */
.w-gallery__track:not(.is-scrub) .w-pc__screen { overflow-y: auto; overscroll-behavior: contain; }

/* ---------- ひとこと ---------- */
.w-note__quote { margin: 0; }
.w-note__quote p {
  font-size: clamp(20px, 2.1vw, 30px); line-height: 1.95; letter-spacing: .08em; font-weight: 500;
  max-width: 22em; text-wrap: pretty;
}
.w-note__quote::before { content: ""; display: block; width: 40px; height: var(--thread-w); background: var(--thread); border-radius: 1px; margin: 4px 0 26px; }
.w-notice {
  grid-column: 2; margin-top: 40px; max-width: 42em;
  font-size: 12.5px; line-height: 1.95; color: var(--mute); letter-spacing: .05em;
  padding-left: 16px; border-left: 1px solid var(--line-strong);
}

/* ---------- 次の作品へ ---------- */
.w-next { padding: var(--space-l) var(--gutter) var(--space-m); border-top: 1px solid var(--line); margin-top: var(--space-m); }
.w-next__label { display: flex; align-items: baseline; gap: 18px; font-weight: 400; margin-bottom: clamp(28px, 4vh, 44px); }
.w-next__label .w-sec__en { font-size: clamp(30px, 2.6vw, 40px); }
.w-next__link {
  --thumb-drop: clamp(48px, 6vw, 96px);
  position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(0, 36%);
  align-items: end; gap: clamp(20px, 3vw, 48px);
  padding: clamp(18px, 3vh, 32px) 0 calc(var(--thumb-drop) + 8px);
}
.w-next__line {
  position: absolute; top: 0; height: 100%;
  left: calc(-1 * var(--gutter)); width: calc(100% + 2 * var(--gutter));
  z-index: 0; overflow: visible; pointer-events: none;
}
.w-next__link > span { position: relative; z-index: 1; }
.w-next__no {
  font-family: var(--f-display); font-weight: 300; line-height: .8; letter-spacing: -.02em;
  font-size: clamp(64px, 8vw, 128px); font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 0;
  padding-bottom: 4px;
}
.w-next__text { display: flex; flex-direction: column; gap: 10px; padding-bottom: 6px; }
.w-next__name { font-size: clamp(14px, 1.15vw, 17px); letter-spacing: .14em; color: var(--mute); transition: color .5s var(--ease); }
.w-next__name [lang] { font-family: var(--f-display); font-size: 1.18em; letter-spacing: .02em; font-variation-settings: "opsz" 24, "SOFT" 100, "WONK" 0; }
.w-next__catch { font-size: clamp(22px, 2.5vw, 38px); line-height: 1.45; letter-spacing: .06em; font-weight: 500; transition: color .5s var(--ease); }
.w-next__thumb { align-self: end; margin-bottom: calc(-1 * var(--thumb-drop)); display: block; border-radius: 5px; overflow: hidden; box-shadow: 0 0 0 1px var(--line); background: var(--kinari); }
.w-next__thumb img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; transition: transform 1.1s var(--ease); }
.w-next__link:hover .w-next__catch, .w-next__link:focus-visible .w-next__catch { color: var(--thread); }
.w-next__link:hover .w-next__thumb img, .w-next__link:focus-visible .w-next__thumb img { transform: scale(1.035); }
.w-next__link:focus-visible { outline-offset: 10px; }
.w-next__back { margin-top: clamp(28px, 4vh, 44px); }

/* ---------- ご相談 ---------- */
.w-contact { padding-bottom: var(--space-l); }
.w-contact__body { max-width: 36em; padding-top: 6px; }
.w-contact__links { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 30px; margin-top: 28px; }

/* ---------- SP ---------- */
@media (max-width: 900px) {
  .w-hero { grid-template-columns: 1fr; row-gap: 18px; padding-top: calc(var(--header-h) + 48px); }
  .w-hero__no-n { font-size: clamp(96px, 30vw, 150px); }
  .w-hero__catch { font-size: clamp(25px, 7vw, 34px); }
  .w-sec__title { margin-bottom: 30px; }
  .w-ov__row { grid-template-columns: 5.6em minmax(0, 1fr); gap: 10px; font-size: 14px; }
  .w-kv { margin-left: 16px; margin-right: 16px; }
  .w-fonts--2 { grid-template-columns: 1fr; }
  .w-font { min-height: 0; }
  .w-route { grid-template-columns: 1fr; padding: 0 0 0 30px; row-gap: 14px; }
  .w-route__step { padding: 0; }
  .w-route__step::before { display: none; }
  .w-route::before {
    content: "";
    position: absolute; left: 9px; right: auto; top: 4px; bottom: 4px; width: var(--thread-w); height: auto;
    background: repeating-linear-gradient(180deg, var(--thread) 0 12px, transparent 12px 19px);
  }
  .w-route__knot { left: -26px; top: 12px; width: 10px; height: var(--thread-w); transform: rotate(-28deg); }
  .w-gallery__grid { grid-template-columns: 1fr; }
  .w-gallery__side .w-phone { position: static; width: min(62vw, 240px); margin: 48px auto 0; }
  .is-scrub .w-gallery__stage { top: calc(var(--header-h) + 10px); }
  .is-scrub .w-pc__screen { height: min(calc(100svh - var(--header-h) - 26px - 80px), 150vw); }
  .w-notice { grid-column: auto; }
  .w-next__link { grid-template-columns: auto minmax(0, 1fr); align-items: end; row-gap: 44px; --thumb-drop: 0px; }
  .w-next__thumb { grid-column: 1 / -1; }
}

/* =========================================================
   404
   ========================================================= */
.nf {
  position: relative; min-height: 100svh;
  display: grid; align-content: center;
  padding: calc(var(--header-h) + 40px) var(--gutter) var(--space-l);
  overflow: hidden;
}
.nf__tangle { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.nf__tangle path { fill: none; stroke: var(--thread); stroke-width: var(--thread-w); stroke-linecap: round; stroke-linejoin: round; }
.nf__tangle .nf__twist { stroke: var(--thread-twist); stroke-width: .7px; stroke-dasharray: 1.2 3.4; opacity: .7; }
.nf__body { position: relative; z-index: 1; max-width: 34em; }
.nf__title { display: flex; flex-direction: column; gap: 18px; font-weight: 400; }
.nf__code {
  font-family: var(--f-display); font-weight: 300; line-height: .8; letter-spacing: -.015em;
  font-size: clamp(120px, 20vw, 300px); margin-left: -.05em;
  font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 0;
}
.nf__ja { font-size: 13px; font-weight: 500; letter-spacing: .3em; color: var(--mute); }
.nf__lead { margin-top: clamp(32px, 5vh, 56px); font-size: clamp(22px, 2.4vw, 32px); line-height: 1.7; letter-spacing: .08em; font-weight: 500; }
.nf__text { margin-top: 18px; max-width: 30em; }
.nf__links { display: flex; flex-wrap: wrap; align-items: center; gap: 18px 30px; margin-top: 36px; }
@media (min-width: 901px) {
  .nf__body { margin-left: clamp(0px, 4vw, 80px); }
}

/* ---------- パンくず（作品詳細・一覧で共通） ---------- */
.w-crumb {
  position: absolute; left: var(--gutter); top: calc(var(--header-h) + clamp(16px, 3vh, 32px));
  font-size: 12px; letter-spacing: .12em; color: var(--mute); line-height: 1.6;
}
.w-crumb ol { display: flex; flex-wrap: wrap; gap: 0 .2em; }
.w-crumb li + li::before { content: "/"; margin: 0 .7em 0 .5em; color: var(--line-strong); }
.w-crumb a { border-bottom: 1px solid var(--line-strong); padding-bottom: 1px; transition: color .4s var(--ease), border-color .4s var(--ease); }
.w-crumb a:hover, .w-crumb a:focus-visible { color: var(--thread); border-color: var(--thread); }
.w-crumb [aria-current] { max-width: 18em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 900px) {
  .page-work .w-hero { padding-top: calc(var(--header-h) + 92px); }
  .w-crumb { top: calc(var(--header-h) + 18px); }
  /* 作品詳細の SP：糸は左の余白だけを下りる。端から 14px・文字から 26px 以上あけるため左の余白を広げる */
  .page-work { --gutter-l: 46px; }
  .page-work .w-hero, .page-work .w-sec, .page-work .w-next { padding-left: var(--gutter-l); }
  .page-work .w-crumb { left: var(--gutter-l); }
  .page-work .w-kv { margin-left: var(--gutter-l); }
  .page-work .w-next__line { left: calc(-1 * var(--gutter-l)); width: calc(100% + var(--gutter-l) + var(--gutter)); }
  .page-work .w-next__link { row-gap: 72px; }   /* 文字の下を通る糸と、サムネイルのあいだをあける */
}
