/* =========================================================
   'ilo 共通スタイル（全ページで共有）
   - デザイントークン / Lenis / リセット / タイポ / ヘッダー・フッター / 共通部品 / 糸
   ========================================================= */
:root {
  /* 色 */
  --ivory: #FBF8F2;
  --kinari: #F3EDE3;          /* 補助の淡色（生成り） */
  --sumi: #2E2826;
  --thread: #993C1D;          /* ブランドカラー */
  --mute: #675D57;            /* 弱い本文（アイボリー上で 6:1 前後） */
  --line: rgba(46, 40, 38, .16);
  --line-strong: rgba(46, 40, 38, .38);
  --line-input: rgba(46, 40, 38, .52);   /* 入力欄・選択肢の枠（3:1 以上） */
  --shadow-device: rgba(46, 40, 38, .55); /* 端末枠の落ち影 */
  --white: #fff;
  --error: #A1301A;
  --placeholder: #8A807A;
  --thread-twist: #EAC6B6;    /* 撚り糸の明るい破線 */

  /* 書体 */
  --f-ja: "Shippori Mincho", "Yu Mincho", "YuMincho", "Hiragino Mincho ProN", serif;
  --f-display: "Fraunces", "Times New Roman", serif;   /* 欧文見出し：SOFT 高め */
  --f-en: "Cormorant Garamond", "Times New Roman", serif; /* 小さな欧文ラベル */

  /* 余白のリズム（8 の倍数を基準に、画面幅で伸縮） */
  --gutter: clamp(22px, 6.1vw, 88px);
  --space-section: clamp(128px, 19vh, 220px);
  --space-l: clamp(64px, 9vh, 112px);
  --space-m: clamp(32px, 4.5vh, 56px);
  --header-h: 84px;
  --col-gap: 24px;            /* 12 カラムのグリッドの列間 */
  --thread-w: 1.6px;          /* 糸・糸を模した線の太さ */

  --ease: cubic-bezier(.22, .61, .36, 1);
  --ease-soft: cubic-bezier(.33, 1.1, .5, 1);
}

/* ---------- リセット ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

/* Lenis 推奨スタイル（lenis.css 相当。CDN の CSS は読まず自前で持つ） */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: hidden; }
.lenis.lenis-scrolling iframe { pointer-events: none; }

body {
  margin: 0;
  background-color: var(--ivory);
  /* ごく薄い紙の繊維感 */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .18 0 0 0 0 .16 0 0 0 0 .15 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  color: var(--sumi);
  font-family: var(--f-ja);
  font-weight: 400;
  font-size: 15px;
  line-height: 2.05;
  letter-spacing: .06em;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "palt" 1;
  font-kerning: normal;
}
img, svg, canvas { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, p, dl, dd, figure { margin: 0; }
h1, h2, h3 { font-weight: 500; }
button, input, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
[lang="en"], [lang="es"], [lang="fr"] { font-feature-settings: normal; }
.nb { white-space: nowrap; }

:focus-visible {
  outline: 1.5px solid var(--thread);
  outline-offset: 5px;
  border-radius: 2px;
}
::selection { background: rgba(153, 60, 29, .16); }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.skip {
  position: fixed; left: 12px; top: -80px; z-index: 200;
  background: var(--sumi); color: var(--ivory); padding: 10px 16px; font-size: 13px;
}
.skip:focus { top: 12px; }

/* 仮の文言（copy.md 反映前）の目印 */
.draft {
  font-family: var(--f-ja); font-size: .72em; color: var(--thread);
  letter-spacing: 0; margin-left: .3em; vertical-align: .15em;
}

/* ---------- セクション見出し：英語の大見出し＋和文を小さく添える ---------- */
.sec-title {
  margin: 0;
  display: flex; flex-direction: column; align-items: flex-start; gap: 18px;
  font-weight: 400;
}
.sec-title__en {
  font-family: var(--f-display);
  font-weight: 300;
  font-size: clamp(60px, 8.4vw, 132px);
  line-height: .86;
  /* 字間：Fraunces の大サイズは詰まりやすいので、マイナスは弱めにしてカーニング（kern）に任せる */
  letter-spacing: -.008em;
  font-kerning: normal; font-feature-settings: "kern" 1;
  font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 0;
  margin-left: -.04em;      /* 大きな字の左サイドベアリングを補正 */
}
.sec-title__ja {
  font-family: var(--f-ja);
  font-size: 13px; font-weight: 500;
  letter-spacing: .32em;
  color: var(--mute);
  padding-left: 2px;
}

/* ---------- ボタン類 ---------- */
/* 文中の控えめなリンク：細い線がすっと引かれる */
.text-link {
  display: inline-block; padding: 4px 0 6px;
  font-size: 13.5px; letter-spacing: .14em;
  background: linear-gradient(var(--line-strong), var(--line-strong)) 0 100% / 100% 1px no-repeat,
              linear-gradient(var(--thread), var(--thread)) 0 100% / 0 1px no-repeat;
  transition: background-size .6s var(--ease), color .4s var(--ease);
}
.text-link:hover, .text-link:focus-visible { color: var(--thread); background-size: 100% 1px, 100% 1px; }
.btn-pill {
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 13px; letter-spacing: .14em; line-height: 1;
  padding: 13px 24px 14px;
  border: 1px solid var(--sumi);
  border-radius: 999px;
  transition: background-color .45s var(--ease), color .45s var(--ease);
}
.btn-pill:hover, .btn-pill:focus-visible { background: var(--sumi); color: var(--ivory); }

/* ---------- ヘッダー ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 60;
  height: var(--header-h);
  display: flex; align-items: center;
  gap: clamp(20px, 2.6vw, 40px);
  padding: 0 var(--gutter);
  transition: background-color .6s var(--ease), box-shadow .6s var(--ease), transform .6s var(--ease);
}
.site-header.is-scrolled {
  background-color: rgba(251, 248, 242, .88);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 1px 0 var(--line);
}
.brand { display: inline-flex; padding: 6px 0; margin-right: auto; color: var(--sumi); }
.brand__mark { width: 64px; height: 38px; transition: color .4s var(--ease); }
.brand:hover .brand__mark { color: var(--thread); }

.gnav__list { display: flex; gap: clamp(18px, 2.2vw, 34px); }
.gnav__list a {
  position: relative; display: inline-block; padding: 6px 0;
  font-size: 13px; letter-spacing: .14em;
}
.gnav__list a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 2px; height: 1px;
  background: var(--thread); transform: scaleX(0); transform-origin: right;
  transition: transform .55s var(--ease);
}
.gnav__list a:hover::after, .gnav__list a:focus-visible::after,
.gnav__list a[aria-current="true"]::after { transform: scaleX(1); transform-origin: left; }

/* 言語切替の予約席（UIは未実装。幅だけ確保） */
.site-header__lang { width: 0; flex: 0 0 auto; }
.site-header__lang:empty { display: block; }

.menu-btn {
  display: none;
  align-items: center; gap: 10px;
  background: none; border: 0; padding: 10px 0 10px 6px; cursor: pointer;
  font-size: 12px; letter-spacing: .16em;
}
.menu-btn__label { min-width: 4.4em; text-align: right; }
.menu-btn__lines { position: relative; width: 22px; height: 8px; }
.menu-btn__lines i {
  position: absolute; left: 0; right: 0; height: 1px; background: currentColor;
  transition: transform .5s var(--ease), top .5s var(--ease);
}
.menu-btn__lines i:first-child { top: 0; }
.menu-btn__lines i:last-child { top: 7px; }
.menu-btn[aria-expanded="true"] .menu-btn__lines i:first-child { top: 4px; transform: rotate(18deg); }
.menu-btn[aria-expanded="true"] .menu-btn__lines i:last-child { top: 4px; transform: rotate(-18deg); }

/* SPメニュー（全画面） */
.sp-menu {
  position: fixed; inset: 0; z-index: 55;
  background: var(--ivory);
  padding: calc(var(--header-h) + 24px) var(--gutter) 40px;
  display: flex; flex-direction: column; justify-content: space-between;
  overflow-y: auto;
}
.sp-menu[hidden] { display: none; }
.sp-menu ul { display: grid; gap: 6px; }
.sp-menu li a {
  display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.sp-menu li [lang="en"] {
  font-family: var(--f-display); font-weight: 300; font-size: 38px; line-height: 1.1;
  font-variation-settings: "opsz" 96, "SOFT" 100, "WONK" 0; letter-spacing: -.02em;
}
.sp-menu li small { font-size: 12px; letter-spacing: .2em; color: var(--mute); }
.sp-menu__sns { font-size: 13px; letter-spacing: .1em; color: var(--mute); padding-top: 32px; }
.sp-menu__sns a { border-bottom: 1px solid var(--line-strong); padding-bottom: 2px; }
.sp-menu.is-in li { animation: menuIn .7s var(--ease) both; }
.sp-menu.is-in li:nth-child(2) { animation-delay: .04s; }
.sp-menu.is-in li:nth-child(3) { animation-delay: .08s; }
.sp-menu.is-in li:nth-child(4) { animation-delay: .12s; }
.sp-menu.is-in li:nth-child(5) { animation-delay: .16s; }
.sp-menu.is-in li:nth-child(6) { animation-delay: .2s; }
@keyframes menuIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ---------- フッター ---------- */
.site-footer {
  position: relative;
  padding: var(--space-l) var(--gutter) 40px;
  border-top: 1px solid var(--line);
}
.site-footer__inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas: "brand tag nav" "copy copy top";
  align-items: end; gap: 28px 48px;
}
.site-footer__brand { grid-area: brand; color: var(--thread); }
.site-footer__brand svg { width: 112px; height: 66px; }
.site-footer__tag { grid-area: tag; font-size: 13px; letter-spacing: .2em; color: var(--mute); padding-bottom: 6px; }
.site-footer__nav { grid-area: nav; display: flex; flex-wrap: wrap; gap: 8px 28px; padding-bottom: 6px; }
.site-footer__nav a {
  font-size: 13px; letter-spacing: .12em;
  background: linear-gradient(var(--thread), var(--thread)) 0 100% / 0 1px no-repeat;
  transition: background-size .5s var(--ease);
  padding-bottom: 2px;
}
.site-footer__nav a:hover, .site-footer__nav a:focus-visible { background-size: 100% 1px; }
.site-footer__top { grid-area: top; justify-self: end; font-size: 12.5px; letter-spacing: .14em; color: var(--mute); border-bottom: 1px solid var(--line-strong); padding-bottom: 2px; }
.site-footer__top:hover { color: var(--thread); }
.site-footer__copy { grid-area: copy; font-family: var(--f-en); font-size: 14px; color: var(--mute); letter-spacing: .08em; }

/* ---------- 糸（TOP・一覧・作品詳細で共通の線） ---------- */
.thread {
  fill: none; stroke: var(--thread); stroke-width: var(--thread-w);
  stroke-linecap: round; stroke-linejoin: round;
}
/* 撚り糸の質感（細い明るい破線を重ねる） */
.thread-twist {
  fill: none; stroke: var(--thread-twist); stroke-width: .7px; stroke-dasharray: 1.2 3.4;
  stroke-linecap: round; opacity: .7;
}

/* ---------- SP ---------- */
@media (max-width: 900px) {
  :root { --header-h: 68px; }
  .gnav { display: none; }
  .site-header__cta { padding: 10px 16px 11px; font-size: 12px; letter-spacing: .1em; white-space: nowrap; }
  .menu-btn { display: inline-flex; white-space: nowrap; }
  .brand__mark { width: 56px; height: 33px; }
  .site-footer__inner { grid-template-columns: 1fr; grid-template-areas: "brand" "tag" "nav" "copy" "top"; gap: 20px; }
  .site-footer__top { justify-self: start; }
  .site-footer__brand svg { width: 96px; height: 56px; }
}
@media (max-width: 380px) {
  .site-header { gap: 14px; }
  .site-header__cta { padding: 9px 13px 10px; }
}

/* ---------- 動きを減らす設定 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-delay: 0s !important;
  }
}

/* ---------- ページ遷移（クロスドキュメント View Transitions） ----------
   両方のページがオプトインしたときだけ動く。非対応ブラウザでは通常の遷移 */
@view-transition { navigation: auto; }
