/* ═══════════════════════════════════════════════════
   INDIGO INDEX — 共通スタイル
   「Notionの静けさ × おさるのジョージの癖」
   ═══════════════════════════════════════════════════ */

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  /* Core palette — paper & ink */
  --ink:        #1A1A18;
  --ink-soft:   #4A4A45;
  --ink-faint:  #8A8880;
  --paper:      #F8F5EE;
  --paper-warm: #EFE9DD;
  --card:       #FFFFFF;
  --line:       #DDD6C8;
  --line-soft:  #EAE4D6;

  /* Indigo brand */
  --indigo:      #2A4A7F;
  --indigo-deep: #1A2A4A;
  --indigo-soft: #E0E5ED;
  --indigo-mid:  #4A6AA0;

  /* Accents */
  --selvedge:   #D4453E;
  --denim-fade: #6B89AB;

  /* Layout tokens */
  --radius:    8px;
  --radius-lg: 14px;
  --max:       1120px;

  /* Motion */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─ Dark theme ─ */
[data-theme="dark"] {
  --ink:        #EFEAE0;
  --ink-soft:   #A8A39A;
  --ink-faint:  #605A52;
  --paper:      #0E1424;
  --paper-warm: #161C2E;
  --card:       #161C2E;
  --line:       #2A3048;
  --line-soft:  #1C2336;
  --indigo:     #7895D0;
  --indigo-soft:#1F2A4A;
  --indigo-mid: #5A78B0;
  --selvedge:   #E25A54;
}

/* ─ Base typography ─ */
html { scroll-behavior: smooth; touch-action: manipulation; overflow-x: hidden; }
body {
  background: var(--paper);
  overflow-x: hidden;
  max-width: 100vw;
  color: var(--ink);
  font-family:
    'Inter',
    'Noto Sans JP',
    -apple-system, BlinkMacSystemFont,
    'Hiragino Kaku Gothic ProN', 'Hiragino Sans', 'Yu Gothic',
    'Helvetica Neue', Arial, sans-serif;
  font-feature-settings: 'palt' 1, 'kern' 1;
  font-weight: 400;
  line-height: 1.75;
  letter-spacing: 0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
}

h1, h2, h3, h4, h5 {
  font-family: 'Inter', 'Noto Sans JP', sans-serif;
  font-feature-settings: 'palt' 1;
  letter-spacing: -0.025em;
  color: var(--ink);
}
h1 { font-size: clamp(34px, 5vw, 54px); font-weight: 900; line-height: 1.1; letter-spacing: -0.035em; }
h2 { font-size: clamp(24px, 3.2vw, 34px); font-weight: 800; line-height: 1.2; margin-bottom: 12px; }
h3 { font-size: clamp(18px, 2.2vw, 22px); font-weight: 700; line-height: 1.35; margin-bottom: 8px; }

a { color: var(--indigo); text-decoration: none; transition: color .15s var(--ease); }
a:hover { color: var(--indigo-deep); }
[data-theme="dark"] a:hover { color: #A5BEE5; }

p { line-height: 1.85; color: var(--ink); margin-bottom: 14px; }
p + p { margin-top: 0; }
strong { font-weight: 700; color: var(--ink); }

/* ═══ HEADER ═══ */
header.site {
  position: sticky; top: 0; z-index: 40;
  background: rgba(248, 245, 238, 0.9);
  backdrop-filter: saturate(160%) blur(10px);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--line);
}
[data-theme="dark"] header.site { background: rgba(14, 20, 36, 0.88); }
.site-inner {
  max-width: var(--max); margin: 0 auto;
  padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
}
.site-brand {
  display: flex; align-items: center; gap: 10px;
  color: var(--ink);
}
.site-brand svg { width: 32px; height: 32px; flex-shrink: 0; }
.site-logo-text {
  font-family: 'Inter', sans-serif;
  font-weight: 900;
  font-size: 17px;
  letter-spacing: 0.02em;
}
.site-logo-sub {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--ink-faint);
  font-weight: 500;
  text-transform: uppercase;
  margin-left: 4px;
}

.site-nav { display: flex; gap: 20px; align-items: center; }
.site-nav a {
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.site-nav a:hover { color: var(--ink); }
.site-nav a.active { color: var(--ink); font-weight: 700; }

.theme-toggle {
  background: none;
  border: 1px solid var(--line);
  padding: 6px 10px;
  border-radius: 20px;
  font-family: inherit;
  font-size: 12px;
  color: var(--ink-soft);
  cursor: pointer;
  line-height: 1;
  transition: all .2s var(--ease);
  display: inline-flex; align-items: center; gap: 4px;
}
.theme-toggle:hover { border-color: var(--ink); color: var(--ink); }

/* ═══ MOBILE HAMBURGER + DRAWER ═══ */
.site-hamburger {
  display: none;           /* shown on mobile via media query */
  background: none;
  border: 1px solid var(--line);
  color: var(--ink);
  width: 36px; height: 36px;
  border-radius: 10px;
  cursor: pointer;
  align-items: center; justify-content: center;
  flex-shrink: 0;
  position: relative;
  transition: border-color .15s var(--ease), background .15s var(--ease);
}
.site-hamburger:hover { border-color: var(--ink); background: var(--paper-warm); }
.site-hamburger span {
  position: absolute;
  left: 9px; right: 9px; height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform .25s var(--ease), opacity .15s var(--ease), top .25s var(--ease);
}
.site-hamburger span:nth-child(1) { top: 11px; }
.site-hamburger span:nth-child(2) { top: 17px; }
.site-hamburger span:nth-child(3) { top: 23px; }
.site-hamburger[aria-expanded="true"] span:nth-child(1) { top: 17px; transform: rotate(45deg); }
.site-hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.site-hamburger[aria-expanded="true"] span:nth-child(3) { top: 17px; transform: rotate(-45deg); }

.site-drawer {
  position: fixed; inset: 0;
  z-index: 90;
  pointer-events: none;
  opacity: 0;
  transition: opacity .25s var(--ease);
}
.site-drawer.open { pointer-events: auto; opacity: 1; }
.site-drawer-bg {
  position: absolute; inset: 0;
  background: rgba(26,42,74,0.35);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
}
.site-drawer-panel {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: min(84vw, 320px);
  background: var(--paper);
  box-shadow: -8px 0 32px rgba(0,0,0,0.18);
  display: flex; flex-direction: column;
  padding-top: max(14px, env(safe-area-inset-top));
  transform: translateX(100%);
  transition: transform .3s var(--ease);
}
.site-drawer.open .site-drawer-panel { transform: translateX(0); }
.site-drawer-head {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 16px 12px;
  border-bottom: 1px solid var(--line);
}
.site-drawer-head img { width: 26px; height: 26px; }
.site-drawer-title {
  font-family: 'Inter', sans-serif; font-weight: 900;
  font-size: 14px; letter-spacing: 0.02em;
  color: var(--ink);
}
.site-drawer-title small {
  display: block;
  font-size: 9.5px; letter-spacing: 0.25em; font-weight: 500;
  color: var(--ink-faint);
  margin-top: 2px;
}
.site-drawer-close {
  margin-left: auto;
  background: none; border: none;
  font-size: 20px;
  color: var(--ink-soft);
  cursor: pointer;
  padding: 6px 10px;
  line-height: 1;
}
.site-drawer-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 8px 16px;
}
.site-drawer-nav a {
  display: flex; align-items: center;
  padding: 12px 16px;
  border-radius: 10px;
  color: var(--ink);
  font-size: 14.5px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.site-drawer-nav a + a { margin-top: 2px; }
.site-drawer-nav a:hover { background: var(--paper-warm); }
.site-drawer-nav a.current {
  background: var(--indigo-soft);
  color: var(--indigo-deep);
}
[data-theme="dark"] .site-drawer-nav a.current { color: #D0DCF0; }
.site-drawer-nav a .ni {
  font-family: 'Inter', sans-serif;
  font-size: 10px; letter-spacing: 0.25em;
  color: var(--ink-faint); font-weight: 700;
  margin-right: 12px;
  text-transform: uppercase;
  min-width: 28px;
}
.site-drawer-foot {
  padding: 14px 20px max(14px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--ink-faint);
}
body.drawer-open { overflow: hidden; }

/* ═══ LAYOUT: chapter page (with sidebar TOC) ═══ */
.page {
  max-width: var(--max);
  margin: 0 auto;
  padding: 48px 24px 96px;
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 56px;
}
.page > .toc { grid-column: 1; }
.page > main { grid-column: 2; min-width: 0; }

/* ─ Sidebar TOC ─ */
.toc {
  position: sticky;
  top: 80px;
  align-self: start;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  padding-right: 12px;
}
.toc-label {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 700;
  margin-bottom: 14px;
}
.toc-list { list-style: none; }
.toc-list li { margin-bottom: 4px; }
.toc-list > li > details { margin: 0; }
.toc-list a, .toc-list summary {
  display: block;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 13px;
  color: var(--ink-soft);
  cursor: pointer;
  list-style: none;
  line-height: 1.5;
  transition: all .15s var(--ease);
}
.toc-list summary::-webkit-details-marker { display: none; }
.toc-list a:hover, .toc-list summary:hover { background: var(--paper-warm); color: var(--ink); }
.toc-list a.current { background: var(--indigo-soft); color: var(--indigo-deep); font-weight: 600; }
[data-theme="dark"] .toc-list a.current { color: #D0DCF0; }
.toc-list details[open] > summary { color: var(--ink); font-weight: 600; }
.toc-list ul { list-style: none; padding-left: 14px; margin-top: 2px; }
.toc-list ul a {
  font-size: 12.5px;
  padding: 5px 10px;
}
.toc-num {
  display: inline-block;
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  color: var(--ink-faint);
  font-weight: 600;
  margin-right: 6px;
  letter-spacing: 0.05em;
}

/* ─ Main content ─ */
main.chapter { max-width: 680px; }
.chapter-kicker {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  letter-spacing: 0.25em;
  color: var(--indigo);
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 12px;
}
.chapter-title { margin-bottom: 18px; }
.chapter-lead {
  font-size: 17px;
  line-height: 1.9;
  color: var(--ink-soft);
  margin-bottom: 40px;
  max-width: 600px;
}

section.block { margin-bottom: 44px; }
section.block > h2 { margin-top: 16px; }
section.block > h3 { margin-top: 16px; }

/* ─ Inline widgets ─ */
.callout {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--paper-warm);
  border-left: 3px solid var(--indigo);
  padding: 16px 18px;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 24px 0;
}
.callout-emoji { font-size: 20px; line-height: 1.4; flex-shrink: 0; }
.callout-body { font-size: 14.5px; line-height: 1.75; color: var(--ink); }
.callout-body strong { font-weight: 700; }

.jean-note {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin: 28px 0;
  position: relative;
}
.jean-note-portrait {
  flex-shrink: 0;
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--paper-warm);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.jean-note-portrait svg { width: 56px; height: 56px; }
.jean-note-body { flex: 1; }
.jean-note-name {
  font-family: 'Inter', sans-serif;
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--indigo);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.jean-note-text { font-size: 14px; line-height: 1.8; color: var(--ink); }

/* ─ Data table ─ */
.kv-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: 14px;
}
.kv-table th, .kv-table td {
  padding: 10px 14px;
  text-align: left;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: top;
}
.kv-table th {
  font-weight: 700;
  color: var(--ink-soft);
  width: 28%;
  font-size: 13px;
}
.kv-table tr:last-child td,
.kv-table tr:last-child th { border-bottom: none; }

/* ─ Weight slider (interactive) ─ */
.weight-slider {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin: 28px 0;
}
.weight-slider input[type="range"] {
  width: 100%;
  accent-color: var(--indigo);
  margin: 12px 0;
}
.weight-value {
  font-family: 'Inter', sans-serif;
  font-size: 32px;
  font-weight: 900;
  color: var(--indigo);
  letter-spacing: -0.02em;
}
.weight-label { font-size: 13px; color: var(--ink-soft); margin-top: 4px; }
.weight-fabric {
  margin-top: 12px; padding: 12px 14px;
  background: var(--indigo-soft);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--indigo-deep);
  font-weight: 600;
}
[data-theme="dark"] .weight-fabric { color: #C5D3E8; }

/* ─ Chapter footer nav ─ */
.chapter-footer {
  margin-top: 72px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  flex-wrap: wrap;
}
.chapter-nav-link {
  display: flex; flex-direction: column; gap: 4px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  color: var(--ink);
  max-width: 46%;
  transition: all .15s var(--ease);
}
.chapter-nav-link:hover {
  border-color: var(--indigo);
  background: var(--indigo-soft);
  color: var(--indigo-deep);
}
[data-theme="dark"] .chapter-nav-link:hover { color: #C5D3E8; }
.chapter-nav-link .hint {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--ink-faint);
  font-weight: 700;
  text-transform: uppercase;
}
.chapter-nav-link .title { font-weight: 600; font-size: 15px; letter-spacing: -0.01em; }
.chapter-nav-link.next { text-align: right; margin-left: auto; }
.chapter-nav-link.prev { text-align: left; }

/* ─ Chapter hero illustration (item pages) ─ */
.chapter-illust {
  margin: 0 0 36px;
  padding: 36px 24px;
  background: linear-gradient(180deg, var(--paper-warm) 0%, transparent 100%);
  border-radius: var(--radius-lg);
  display: flex; justify-content: center; align-items: center;
  position: relative;
  overflow: hidden;
}
.chapter-illust::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 30% 40%, rgba(42,74,127,0.08), transparent 60%),
    repeating-linear-gradient(110deg, transparent 0 28px, rgba(42,74,127,0.04) 28px 29px, transparent 29px 58px);
  pointer-events: none;
}
.chapter-illust img {
  position: relative;
  height: 220px; width: auto;
  filter: drop-shadow(0 10px 28px rgba(26,42,74,0.2));
}
@media (max-width: 900px) {
  .chapter-illust { padding: 24px 18px; }
  .chapter-illust img { height: 170px; }
}

/* ═══ INDEX PAGE — hero (lively version) ═══ */
.hero-idx {
  position: relative;
  max-width: var(--max);
  margin: 0 auto;
  padding: 72px 24px 56px;
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 40px;
  align-items: center;
  overflow: hidden;
}

/* 背景の動くストライプ（藍のラインが流れる） */
.hero-idx-stripes {
  position: absolute; inset: 0; z-index: 0;
  overflow: hidden; pointer-events: none;
  border-radius: 24px;
  opacity: 0.35;
}
.hero-idx-stripes::before {
  content: '';
  position: absolute; inset: -10% -10% -10% -10%;
  background:
    repeating-linear-gradient(
      110deg,
      transparent 0 28px,
      rgba(42,74,127,0.08) 28px 30px,
      transparent 30px 72px,
      rgba(42,74,127,0.05) 72px 74px
    );
  animation: heroStripeDrift 22s linear infinite;
}
[data-theme="dark"] .hero-idx-stripes { opacity: 0.5; }
@keyframes heroStripeDrift {
  0%   { transform: translate3d(0,0,0); }
  100% { transform: translate3d(-140px,-60px,0); }
}

/* 浮遊するドット（光粒）*/
.hero-idx-dots {
  position: absolute; inset: 0; z-index: 0;
  pointer-events: none;
}
.hero-idx-dots span {
  position: absolute;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--indigo);
  opacity: 0.18;
  animation: heroDotFloat 11s ease-in-out infinite;
}
.hero-idx-dots span:nth-child(1) { top: 14%; left:  8%; width:  8px; height:  8px; animation-delay:  0s;  background: var(--indigo); }
.hero-idx-dots span:nth-child(2) { top: 72%; left: 20%; width:  5px; height:  5px; animation-delay: -2.2s; background: var(--selvedge); opacity: 0.22; }
.hero-idx-dots span:nth-child(3) { top: 28%; left: 88%; width:  7px; height:  7px; animation-delay: -4.4s; }
.hero-idx-dots span:nth-child(4) { top: 84%; left: 76%; width:  6px; height:  6px; animation-delay: -6.6s; }
.hero-idx-dots span:nth-child(5) { top:  6%; left: 56%; width:  4px; height:  4px; animation-delay: -8.8s; background: var(--denim-fade); opacity: 0.28; }
.hero-idx-dots span:nth-child(6) { top: 54%; left:  4%; width:  9px; height:  9px; animation-delay: -1.1s; }
.hero-idx-dots span:nth-child(7) { top: 92%; left: 44%; width:  4px; height:  4px; animation-delay: -3.3s; background: var(--selvedge); }
.hero-idx-dots span:nth-child(8) { top: 38%; left: 30%; width:  5px; height:  5px; animation-delay: -5.5s; }
@keyframes heroDotFloat {
  0%, 100% { transform: translate3d(0,   0, 0) scale(1);   opacity: 0.18; }
  50%      { transform: translate3d(18px,-24px,0) scale(1.4); opacity: 0.42; }
}

.hero-idx-text { position: relative; z-index: 2; }

.hero-idx-eyebrow {
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--indigo);
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 20px;
  display: inline-flex; align-items: center; gap: 10px;
  padding: 6px 12px;
  background: var(--indigo-soft);
  border-radius: 100px;
  animation: heroEyebrowIn .8s .1s var(--ease) both;
}
.hero-idx-eyebrow::before {
  content: '';
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--selvedge);
  box-shadow: 0 0 0 0 rgba(212,69,62,0.6);
  animation: heroEyebrowPulse 2.2s ease-in-out infinite;
}
@keyframes heroEyebrowIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes heroEyebrowPulse {
  0%, 100% { box-shadow: 0 0 0 0   rgba(212,69,62,0.55); transform: scale(1); }
  50%      { box-shadow: 0 0 0 10px rgba(212,69,62,0);   transform: scale(1.2); }
}

.hero-idx-title {
  font-size: clamp(44px, 7.4vw, 92px);
  font-weight: 900;
  line-height: 1;
  letter-spacing: -0.045em;
  margin-bottom: 22px;
  color: var(--ink);
}
.hero-idx-title .word {
  display: inline-block;
  opacity: 0;
  transform: translateY(26px) rotate(-1deg);
  animation: heroWordIn .85s var(--ease) forwards;
}
.hero-idx-title .word:nth-child(1) { animation-delay: .25s; }
.hero-idx-title .word:nth-child(2) { animation-delay: .40s; }
.hero-idx-title .word:nth-child(3) { animation-delay: .55s; }
.hero-idx-title .word:nth-child(4) { animation-delay: .70s; }
@keyframes heroWordIn {
  to { opacity: 1; transform: translateY(0) rotate(0); }
}

.hero-idx-title .line-indigo {
  color: var(--indigo);
  position: relative;
  white-space: nowrap;
}
.hero-idx-title .line-indigo::after {
  content: '';
  position: absolute;
  left: 0; right: 0; bottom: 2px;
  height: 10px;
  background: linear-gradient(90deg, var(--selvedge), #F0A8A4);
  opacity: 0.32;
  transform: scaleX(0);
  transform-origin: left;
  animation: heroUnderline 1.1s 1.0s var(--ease) forwards;
  z-index: -1;
  border-radius: 4px;
}
@keyframes heroUnderline {
  to { transform: scaleX(1); }
}

/* タイトル中に散らばる小アイコン（糸・インディゴの滴） */
.hero-idx-sprinkle {
  position: absolute;
  pointer-events: none;
  font-size: 22px;
  opacity: 0;
  animation: heroSprinkleIn 1s 1.4s var(--ease) forwards,
             heroSprinkleFloat 4.5s 2.4s ease-in-out infinite;
}
.hero-idx-sprinkle.s1 { top: -12px; right: 12%; color: var(--selvedge); transform: rotate(-14deg); animation-delay: 1.3s, 2.3s; }
.hero-idx-sprinkle.s2 { bottom: 36%; right: -4px; color: var(--indigo-mid); transform: rotate(12deg); animation-delay: 1.55s, 2.55s; }
.hero-idx-sprinkle.s3 { top: 56%; left: -14px; color: var(--denim-fade); transform: rotate(-8deg); animation-delay: 1.8s, 2.8s; }
@keyframes heroSprinkleIn { to { opacity: 0.9; } }
@keyframes heroSprinkleFloat {
  0%, 100% { transform: translateY(0) rotate(var(--r,0deg)); }
  50%      { transform: translateY(-10px) rotate(var(--r,0deg)); }
}

.hero-idx-lead {
  font-size: clamp(15px, 1.6vw, 18px);
  line-height: 1.9;
  color: var(--ink-soft);
  margin-bottom: 28px;
  max-width: 520px;
  animation: heroLeadIn .9s 1.0s var(--ease) both;
}
@keyframes heroLeadIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-idx-cta-row {
  display: flex; gap: 12px; align-items: center;
  flex-wrap: wrap;
  animation: heroLeadIn .9s 1.2s var(--ease) both;
}
.hero-idx-cta {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 22px;
  background: var(--ink); color: var(--paper);
  border-radius: var(--radius);
  font-size: 14px; font-weight: 600;
  letter-spacing: 0.02em;
  transition: background .2s var(--ease), transform .2s var(--ease);
  position: relative; overflow: hidden;
}
.hero-idx-cta::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255,255,255,0.22) 50%, transparent 80%);
  transform: translateX(-100%);
  transition: transform .7s var(--ease);
}
.hero-idx-cta:hover { background: var(--indigo-deep); color: var(--paper); transform: translateY(-2px); }
.hero-idx-cta:hover::after { transform: translateX(100%); }
.hero-idx-cta .arrow { transition: transform .2s var(--ease); }
.hero-idx-cta:hover .arrow { transform: translateX(4px); }

.hero-idx-cta.ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
.hero-idx-cta.ghost:hover {
  background: var(--paper-warm);
  border-color: var(--ink);
  color: var(--ink);
}

.hero-idx-art {
  position: relative; z-index: 2;
  display: flex; align-items: center; justify-content: center;
  min-height: 420px;
}
.hero-idx-art-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 30% 30%, var(--indigo-soft), transparent 60%),
    radial-gradient(circle at 70% 70%, rgba(212, 69, 62, 0.18), transparent 60%);
  filter: blur(20px);
  z-index: 0;
  animation: heroBgBreath 7s ease-in-out infinite;
}
@keyframes heroBgBreath {
  0%, 100% { transform: scale(1);    opacity: 1; }
  50%      { transform: scale(1.12); opacity: 0.85; }
}

/* ジーンの周囲に回る同心円 */
.hero-idx-orbit {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  z-index: 1; pointer-events: none;
}
.hero-idx-orbit::before,
.hero-idx-orbit::after {
  content: '';
  position: absolute;
  border: 1.2px dashed var(--indigo);
  border-radius: 50%;
  opacity: 0.25;
}
.hero-idx-orbit::before {
  width: 320px; height: 320px;
  animation: heroOrbitSpin 30s linear infinite;
}
.hero-idx-orbit::after {
  width: 420px; height: 420px;
  border-color: var(--selvedge);
  opacity: 0.18;
  animation: heroOrbitSpin 45s linear reverse infinite;
}
@keyframes heroOrbitSpin {
  to { transform: rotate(360deg); }
}

/* ジーンの台座（ゆらゆら揺れる円） */
.hero-idx-pedestal {
  position: absolute;
  bottom: 18%; left: 50%;
  width: 230px; height: 24px;
  transform: translateX(-50%);
  background: radial-gradient(ellipse, rgba(26,42,74,0.18), transparent 70%);
  z-index: 1;
  animation: heroPedestal 2.6s ease-in-out infinite;
}
@keyframes heroPedestal {
  0%, 100% { transform: translateX(-50%) scale(1);   opacity: 0.6; }
  50%      { transform: translateX(-50%) scale(0.82);opacity: 0.35; }
}

/* ジーン本体：浮遊＋揺れ＋表情切り替え */
.hero-idx-jean-wrap {
  position: relative; z-index: 2;
  width: 300px; height: 320px;
  display: flex; align-items: center; justify-content: center;
  animation: heroJeanBounce 2.6s ease-in-out infinite;
}
@keyframes heroJeanBounce {
  0%, 100% { transform: translateY(0)    rotate(-1deg); }
  50%      { transform: translateY(-14px) rotate(1.5deg); }
}
.hero-idx-jean {
  position: absolute;
  width: 260px; height: auto;
  filter: drop-shadow(0 20px 40px rgba(26,42,74,0.25));
  opacity: 0;
  transition: opacity .35s var(--ease);
}
.hero-idx-jean.on { opacity: 1; }
.hero-idx-jean.wave { animation: heroJeanWave 2.4s ease-in-out infinite; transform-origin: 50% 75%; }
@keyframes heroJeanWave {
  0%, 100% { transform: rotate(0); }
  25%      { transform: rotate(-3deg); }
  75%      { transform: rotate(3deg); }
}

/* ふきだし */
.hero-idx-bubble {
  position: absolute;
  top: 6%; right: -6%;
  background: var(--card);
  border: 1.5px solid var(--ink);
  border-radius: 16px;
  padding: 10px 14px;
  font-size: 12.5px; font-weight: 600;
  color: var(--ink);
  line-height: 1.4;
  max-width: 170px;
  z-index: 3;
  box-shadow: 4px 4px 0 var(--ink);
  opacity: 0;
  transform: translateY(-6px) scale(0.9);
  animation: heroBubbleIn .5s 1.6s var(--ease) forwards, heroBubbleFloat 3.2s 2.2s ease-in-out infinite;
}
.hero-idx-bubble::before {
  content: '';
  position: absolute;
  bottom: -10px; left: 22px;
  width: 16px; height: 16px;
  background: var(--card);
  border-right: 1.5px solid var(--ink);
  border-bottom: 1.5px solid var(--ink);
  transform: rotate(45deg);
}
@keyframes heroBubbleIn {
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes heroBubbleFloat {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-6px); }
}

/* リベットスタンプ（装飾） */
.hero-idx-rivets {
  position: absolute; inset: 0; z-index: 1; pointer-events: none;
}
.hero-idx-rivets span {
  position: absolute;
  width: 10px; height: 10px;
  background: var(--indigo-deep);
  border-radius: 50%;
  box-shadow: inset 0 0 0 2px var(--paper), 0 2px 0 rgba(0,0,0,0.18);
  opacity: 0;
  animation: heroRivetPop .5s var(--ease) forwards;
}
.hero-idx-rivets span:nth-child(1) { top:  8%; left: 16%; animation-delay: 1.7s; }
.hero-idx-rivets span:nth-child(2) { top: 78%; left: 12%; animation-delay: 1.85s;}
.hero-idx-rivets span:nth-child(3) { top: 14%; right: 12%; animation-delay: 2.0s; }
.hero-idx-rivets span:nth-child(4) { top: 84%; right: 18%; animation-delay: 2.15s;}
@keyframes heroRivetPop {
  0%   { opacity: 0; transform: scale(0); }
  60%  { opacity: 1; transform: scale(1.4); }
  100% { opacity: 0.8; transform: scale(1); }
}

/* セルヴィッジ赤線（右端を走る装飾） */
.hero-idx-selvedge-line {
  position: absolute;
  top: 0; bottom: 0; right: 4%;
  width: 2px;
  background: linear-gradient(180deg, transparent 0%, var(--selvedge) 20%, var(--selvedge) 80%, transparent 100%);
  z-index: 1;
  opacity: 0.55;
}

/* ─ Introduction section ─ */
.intro-sec {
  max-width: var(--max);
  margin: 40px auto 0;
  padding: 64px 24px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.intro-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
}
.intro-label {
  font-family: 'Inter', sans-serif;
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.25em;
  color: var(--ink-faint);
  text-transform: uppercase;
  margin-bottom: 16px;
}
.intro-text p {
  font-size: 15px;
  line-height: 2;
  color: var(--ink);
}
.intro-text p + p { margin-top: 14px; }

/* ─ TOC (index page main area) ─ */
.index-toc {
  max-width: var(--max);
  margin: 0 auto;
  padding: 88px 24px;
}
.index-toc-head {
  display: grid; grid-template-columns: auto 1fr auto;
  gap: 14px; align-items: baseline;
  margin-bottom: 40px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--ink);
}
.index-toc-num {
  font-family: 'Inter', sans-serif;
  font-size: 11px; font-weight: 800;
  letter-spacing: 0.2em;
  color: var(--indigo);
  text-transform: uppercase;
}
.index-toc-title {
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 900;
  letter-spacing: -0.02em;
}
.index-toc-meta { font-size: 12px; color: var(--ink-faint); font-family: 'Inter',sans-serif; letter-spacing: 0.1em; }

.index-ch-list { list-style: none; display: flex; flex-direction: column; }
.index-ch {
  display: grid;
  grid-template-columns: 60px 1fr auto;
  gap: 24px;
  align-items: center;
  padding: 24px 4px;
  border-top: 1px solid var(--line);
  text-decoration: none;
  color: var(--ink);
  transition: background .15s var(--ease);
}
.index-ch:first-child { border-top: none; }
.index-ch:hover { background: var(--paper-warm); }
[data-theme="dark"] .index-ch:hover { background: var(--paper-warm); }
.index-ch-num {
  font-family: 'Inter', sans-serif;
  font-size: 24px; font-weight: 900;
  color: var(--indigo);
  letter-spacing: -0.02em;
}
.index-ch-title {
  font-size: 19px; font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}
.index-ch-sub { font-size: 13px; color: var(--ink-soft); line-height: 1.6; }
.index-ch-arrow {
  font-size: 20px; color: var(--ink-faint);
  transition: transform .2s var(--ease), color .15s var(--ease);
}
.index-ch:hover .index-ch-arrow { transform: translateX(4px); color: var(--indigo); }

/* ═══ FOOTER ═══ */
footer.site {
  max-width: var(--max); margin: 0 auto;
  padding: 40px 24px 60px;
  border-top: 1px solid var(--line);
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px;
  font-size: 12px; color: var(--ink-faint);
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.08em;
}
footer.site a { color: var(--ink-faint); }
footer.site a:hover { color: var(--ink); }

/* ─ Animation: fade in on scroll ─ */
.fade-in {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .6s var(--ease), transform .6s var(--ease);
}
.fade-in.on { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  .fade-in { opacity: 1; transform: none; transition: none; }
  * { animation: none !important; transition: none !important; }
}

/* ─ Responsive ─ */
@media (max-width: 900px) {
  /* Header: ハンバーガー＋ドロワーに切替 */
  .site-inner { gap: 10px; padding: 12px 16px; }
  .site-nav { display: none; }
  .site-hamburger { display: inline-flex; }
  .site-brand { flex-shrink: 0; margin-right: auto; }
  .theme-toggle { flex-shrink: 0; padding: 6px 8px; font-size: 11px; }

  /* Hero: モバイルではジーンの揺れ幅を小さく、水平成分を無効化 */
  .hero-idx { grid-template-columns: 1fr; padding: 40px 20px 32px; gap: 28px; text-align: center; border-radius: 0; }
  .hero-idx-lead { margin: 0 auto 22px; }
  .hero-idx-cta-row { justify-content: center; }
  .hero-idx-art { min-height: 300px; }
  .hero-idx-jean-wrap { width: 220px; height: 240px; animation: heroJeanBounceMobile 2.8s ease-in-out infinite; }
  .hero-idx-jean { width: 190px; }
  .hero-idx-jean.wave { animation: none; }   /* 水平回転を停止 */
  .hero-idx-orbit::before { width: 240px; height: 240px; }
  .hero-idx-orbit::after  { width: 320px; height: 320px; }
  .hero-idx-bubble {
    top: -4px; right: auto; left: 50%;
    transform: translateX(-50%);
    font-size: 11.5px; padding: 7px 12px; max-width: 160px;
    animation: heroBubbleInMobile .5s 1.6s var(--ease) forwards;
  }
  .hero-idx-bubble::before { left: 50%; transform: translateX(-50%) rotate(45deg); }
  .hero-idx-pedestal { width: 160px; bottom: 20%; }

  /* スプリンクル・リベット：モバイルでは非表示（横ハミ出し原因の一つ） */
  .hero-idx-sprinkle,
  .hero-idx-rivets,
  .hero-idx-selvedge-line { display: none; }

  /* タイトル語のrotate微ズレをモバイルでは無効化 */
  .hero-idx-title .word { transform: translateY(26px); animation-name: heroWordInFlat; }
}
@keyframes heroJeanBounceMobile {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}
@keyframes heroBubbleInMobile {
  from { opacity: 0; transform: translateX(-50%) translateY(-6px) scale(0.9); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0)    scale(1); }
}
@keyframes heroWordInFlat {
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 900px) {
  .intro-sec { padding: 40px 20px; }
  .intro-grid { grid-template-columns: 1fr; gap: 24px; }
  .index-toc { padding: 56px 20px; }
  .index-ch { grid-template-columns: 44px 1fr auto; gap: 16px; padding: 18px 2px; }
  .index-ch-num { font-size: 20px; }
  .index-ch-title { font-size: 16px; }

  .page { grid-template-columns: 1fr; gap: 24px; padding: 32px 20px 72px; }
  .page > .toc { grid-column: 1; position: static; max-height: none; padding-right: 0; }
  .toc details { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 0; }
  .site-logo-sub { display: none; }
  .chapter-footer { flex-direction: column; align-items: stretch; }
  .chapter-nav-link { max-width: 100%; }
}
